Ячейка как ссылка (всплывающее окно на jquery)?
Доброго дня, люди добрые, подскажите как вызвать всплывающее окно при клике на всю область ячейки?
<a href="#popup1" name="loadpopunder">Ссылка</a> При клике на "Ссылка" всплывающее окно нормально открывается но как задействовать всё поле ячейки в таблице - как ссылку? Пробовал таким образом, при нажатии на ячейку ничего не происходит. <td class="td1" onClick="document.location='#popup1'" name="loadpopunder"></td> Используется следующий скрипт всплывающего окна //Pop-under window II- By JavaScript Kit //Credit notice must stay intact for use //Visit [url]http://javascriptkit.com[/url] for this script //Pop-under only once per browser session? (0=no, 1=yes) //Specifying 0 will cause popunder to load every time page is loaded var once_per_session=1 ///No editing beyond here required///// function get_cookie(Name) { var search = Name + "=" var returnvalue = ""; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search) if (offset != -1) { // if cookie exists offset += search.length // set index of beginning of value end = document.cookie.indexOf(";", offset); // set index of end of cookie value if (end == -1) end = document.cookie.length; returnvalue=unescape(document.cookie.substring(offset, end)) } } return returnvalue; } function loadornot(){ if (get_cookie('popunder')==''){ loadpopunder() document.cookie="popunder=yes" } } function loadpopunder(){ var id = '#popup1'; //Get the screen height and width var mask1Height = jQuery(document).height(); var mask1Width = jQuery(window).width(); //Set heigth and width to mask to fill up the whole screen jQuery('#mask1').css({'width':mask1Width,'height':mask1Height}); //transition effect jQuery('#mask1').fadeIn(1000); jQuery('#mask1').fadeTo("slow",0.8); //Get the window height and width var winH = jQuery(window).height(); var winW = jQuery(window).width(); //Set the popup window to center jQuery(id).css('top', winH/2-jQuery(id).height()/2); jQuery(id).css('left', winW/2-jQuery(id).width()/2); //transition effect jQuery(id).fadeIn(2000); } jQuery(document).ready(function() { jQuery('a[name=loadpopunder]').click(function(e) { e.preventDefault(); var id = jQuery(this).attr('href'); loadpopunder(id); // вызываем по клику }); jQuery('.window1 .close1').click(function (e) { e.preventDefault(); jQuery('#mask1, .window1').hide(); }); jQuery('#mask1').click(function () { jQuery(this).hide(); jQuery('.window1').hide(); }); }); Заранее очень благодарен! |
Часовой пояс GMT +3, время: 13:00. |