Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.