jquery - How to show div as popup on click of anchor tag? -


i want show div popup on-click of anchor tag image. have 1 main image , 4 vertical thumbnails side of image.

on main image, top corner 1 anchor tag image there. upon clicking on image, want whole main image , thumbnails show in popup.

if i'm not wrong, jquery core doesn't have method show modal\pop up.

you can achieve request in vanilla javascript in way:

<a id="picture1" data-id="1" href="#" onclick="showdialog(this);">     <!-- img or whatever --> </a>  <dialog id="picturedialog">     <!-- dialog content --> </dialog>  <script>     function showdialog(element) {         var id = e.getattribute("data-id");         //do setup dialog         document.getelementbyid("picturedialog").showmodal();      }  </script> 

remaining in jquery family, can open modal using jquery ui: http://api.jqueryui.com/dialog

or adding framework of flavor, bootstrap: http://getbootstrap.com/javascript/#modals


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -