Ok so I have a few questions here. I want my function to work inside the Iframe, but I want to call it from outside the Iframe, the main page. The iframe is going to be doing the same jquery function as the inframe only I want them to go in different directions (scrolling). The trigger for the function of the jquery on the main page is on click of the link. I want the jquery function inide the iframe to trigger on the same click(the click of the link on the main page)
Here is my code:
Main Page Code:
Code:<iframe style="position:absolute; width:25%; height:1000%; z-index: 80; FILTER: chroma (color=FFFFFF)" src="extra.html" frameborder="0" id="section" class="nav"> <script type="text/javascript"> function putme() { window.frames['section'].putme(); } $(function() { $('ul.nav a').bind('click',function(event){ var $anchor = $(this); $('html, body').stop().animate({ scrollTop: $($anchor.attr('href')).offset().top }, 7500,'easeInOutExpo'); event.preventDefault(); }); }); </script> </iframe>
Here is the page being loaded into the Iframe code:
Code:<script type="text/javascript"> function putme() { window.frames['section'].putme(); } $(function() { $('ul.nav a').bind('click',function(event){ var $anchor = $(this); $('html, body').stop().animate({ scrollTop: $($anchor.attr('href')).offset().top }, 7500,'easeInOutExpo'); event.preventDefault(); }); }); </script>



Reply With Quote

Bookmarks