jquery - load dialog box before page loads -


when click on 1 of links, dialog box should open shown data should not removed page. please find code here: http://jsfiddle.net/ssly3/50/

please check sample code below:

$(document).ready(function () {     $('a').click(function (e) {         e.preventdefault();         $("#content1").load($(this).attr('href'));     }); });  $(function () {     $("#dialog").dialog(); }); 

when click on page3 link, dialog box should open content on , shown data when clicked on home/page1/page2 should not removed page, please suggest.

you need put on 3rd "about" link know not process it. e.g. class

<li><a href="page4.html" class="about">page 3</a> 

then code becomes like:

$(document).ready(function () {     $('a').click(function (e) {         e.preventdefault();         if ($(this).is('.about')) {             $("#dialog").dialog();         } else {             $("#content1").load($(this).attr('href'));         }     }); }); 

Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -