Popup image on click the link using Jquery | Sanwebcorner

Popup image on click the link using Jquery

Today will learn How to show image as a popup on click the link using Jquery. This is very simple concept will easily do with the help of jquery. You can customize the popup image by editing jquery.fancybox file. In this file you can set the speed of the animation open image in the popup and also you can set the loop and opacity, zoom option etc... 

In this example you should add the image to div with the id name is hidden-content that image will display in the popup field. And then you just call the id hidden-content in the <a> tag like below code after included necessary jquery and javascript and css files. This post shows image in the popup window while clicking the link. You can also add the link in the popup image by using <a> tag in your hidden-content div.

<a data-fancybox data-src="#hidden-content" href="javascript:;">
Click link View popup image
</a>

I hope this example will help you how to open an image in the popup mode on click the link. Below is the full code you can download code and use it your projects. And also i provided the demo link check it out below. I think this is very useful to you, If it is useful please support us by sharing this post to social media. Thanks lot.


Popup image on click the url using Jquery




Code for onclick Popup image:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Popup image on click the link using Jquery</title>

<!-- CSS -->
<link rel="stylesheet" type="text/css" href="jquery.fancybox.css">
</head>
<body>
<br/><br/><br/><br/><br/><br/>
<center><!-- Your HTML content goes here -->
<div style="display: none;" id="hidden-content">
<img src="sanwebcorner.jpg" />
</div>
<a data-fancybox data-src="#hidden-content" href="javascript:;">
Click link View popup image
</a>
<br/><br/><br/><br/><br/><br/>

<a href="http://www.sanwebcorner.com">www.sanwebcorner.com</a>
</center>
<!-- JS -->
<script src="http://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="jquery.fancybox.js"></script>
</body>
</html>

Post a Comment

Labels

360 degree view product image 3d rotate 3d text 3step-form Accordion menu ajax All Browsers Animated Background Gradient animation audio controller auto complete Best accordion menu bootstrap border bounce effect on hover Breadcrumb calculate age by dob calendar Captcha change image on mouse move color chooser countdown Counter on scroll Css css animation css buttons css hover css3 customized upload Button Date picker delete data from table Different scroll speed email otp verification email verifier Embed eventlist Expanding Menu feedbck form flash news section close button full screen menu Google custom search Google Maps Google reCAPTCHA Google site search gradient hide menu Horizontal News ticker Hover Htm Html html5 html5 form validation Iframe image hover increment decrement textbox value based on select box Javascript Jquery js Layered image effect on mouse hover marquee marquee with close button mobile number validation mobile otp login Multi-level-drop-down-menu multi-level-form mysql News ticker on hover change text to image our team page password strength checker Photoshop PHP Popup image on click the link pure css Random password Redirect page Based on the select box while submit the form responsive responsive menu responsive popup box Responsive Vertical Time line design rotate image simple coming soon page simple countdown based on end date simple typing effect slider sliding tab sms otp login statistic counter on scroll switch tag shape team member Time picker toggle toggle view transparent button underline animation up down slide validation vertical fixed sidebar Webtips Youtube