Jump to content

jQuery scroll issue


andyd34

Recommended Posts

I'm playing around with things in phpbb and am adding jQuery to a lot of things. With a few of the pages i'm putting them in modal windows just for convenience really.

 

I tried loading the faq.php into a modal window and everything was great until i tried using the scroll function, the problem is when the page is loaded normally everything works but when its loaded inside the modal div its scrolling the parent page. I cant post a link as its on my testing server on my local network but here is the code

 

to scroll to the answer

$("#f{faq_block.S_ROW_COUNT}r{faq_block.faq_row.S_ROW_COUNT}").click(function(){
$('html, body').animate({scrollTop:$("#l{faq_block.S_ROW_COUNT}_{faq_block.faq_row.S_ROW_COUNT}").offset().top}, 2000); 
return false
});

 

and the back to top link is

$("#a{faq_block.S_ROW_COUNT}_{faq_block.faq_row.S_ROW_COUNT}").click(function(){
$('html, body').animate({scrollTop:$("#faqtop").offset().top}, 2000);
return false
});

 

like i said when the page is loaded normally it works great but when loaded inside the div it isnt scrolling the page inside the div its scrolling the main page

 

Any suggestions would be gratefully appreciated

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/273217-jquery-scroll-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.