| Issue 120: | Modal iframe keeps loading same content | |
| 2 people starred this issue and may be notified of changes. | Back to list |
What is the expected output? What do you see instead?
I want to view different content when a different link is clicked.
If I click a link on a page to open the modal (iframe) the first time it
loads the correct page into the iframe. If I close the modal and
subsequently click another modal link, it loads the exact same page into
the iframe it did the first time.
What version of the product are you using? On what operating system?
nyroModal 1.3.0
Windows Vista 32bit
Firefox 3
Internet Explorer 7
Using nyroModal in an ASP-driven website
Please provide any additional information below.
This is the code I'm using:
[CODE]
$(document).ready(function(){
$(document).bind("click", function(e){
var el = e.srcElement || e.target;
if(el.tagName=="A" && el.className=="openwn"){
e.preventDefault();
var w, h, sz = el.rel.split(':');
if (sz.length==2) { w=sz[0]; h=sz[1] } else { w=600; h=400; } // custom
size via link attribute rel="600:400"
$.nyroModalSettings({zIndex: 1000}, 'css', 'bg');
$.nyroModalSettings({zIndex: 1001}, 'css', 'wrapper');
$.nyroModalSettings({zIndex: 1002}, 'css', 'loading');
$.nyroModalSettings({modal: true, height: h, width: w, url: el.href});
$.nyroModalManual();
return false;
}
});
});
[/CODE]
As you can see there's a little custom coding to set the height and width.
Nov 24, 2008
#1
siegert....@gmail.com
Nov 25, 2008
If you want set settings in the link tag, check out the url plugin developped by somebody else: https://code.google.com/p/nyromodal/issues/detail?id=46
Nov 25, 2008
I read about the plugin but that's not my issue. My issue is that I have several links in a page (with classname "openwn"). Every link leads to a different page. If I click one of those links, all is well, but if I click another link the exact same page from the first link appears. Somehow the url to the "first clicked" link is stored in memory and will load from any other "modaled" link in the page. Unless I reload the parent page.
Nov 25, 2008
I think i got your problem.
Instead of writing:
$.nyroModalSettings({modal: true, height: h, width: w, url: el.href});
$.nyroModalManual();
Try:
$.nyroModalSettings({modal: true, height: h, width: w});
$.nyroModalManual({url: el.href});
Nov 25, 2008
Thanks, I'll try that
Nov 25, 2008
that works :) Thanks.
I actually changed it to:
$.nyroModalManual({modal: true, height: h, width: w, url: el.href});
Nov 25, 2008
that makes sens to do as you did ;)
Status:
Fixed
Labels: Type-Other |