www.webdeveloper.com
Results 1 to 7 of 7

Thread: iframe's scroll bar not responding to onmouseup

  1. #1
    Join Date
    Apr 2005
    Posts
    35

    iframe's scroll bar not responding to onmouseup

    1) I have a webpage that contains an iframe. The iframe is scrollable.

    2) I have the main body of the page responding to onmouseup clicks:

    <body onmouseup="hideMenus(event)">

    And I have the main body of the child page (displayed in the iframe) also responding to onmouseup clicks:

    <body onmouseup="parent.hideMenus(event)">

    So clicks on both pages result in hideMenu() on the parent page being called.

    Now when the scroll bars on the iframe become visible (due to large amounts of content), I click on the scroll bar, and the hideMenus() function does not respond. I guess the scroll bar is not recognized as part of either the parent page or the iframe's page. I tried adding

    onmouseup="hideMenus(event)"

    to the iframe but that didn't help.

    How can I get mouse clicks on the iframe's scroll bar to result in hideMenu being called?

    The website can be viewed here: http://www.shahspace.com/bow/home.html

  2. #2
    Join Date
    Apr 2010
    Location
    Salem,Ma
    Posts
    623
    i couldnt find a link in the menus that would present scrollbars so I couldnt experiment, but more importantly, I feel I should point out, with the way you have coded this the site completely breaks if you do not have javascript turned on.

    why iframes, why not jsut use ajax calls instead?

  3. #3
    Join Date
    Apr 2010
    Location
    Salem,Ma
    Posts
    623
    i couldnt find a link in the menus that would present scrollbars so I couldnt experiment, but more importantly, I feel I should point out, with the way you have coded this the site completely breaks if you do not have javascript turned on.

    why iframes, why not jsut use ajax calls instead?

  4. #4
    Join Date
    Apr 2005
    Posts
    35
    Quote Originally Posted by DanInMA View Post
    i couldnt find a link in the menus that would present scrollbars so I couldnt experiment, but more importantly, I feel I should point out, with the way you have coded this the site completely breaks if you do not have javascript turned on.
    Under information > Facts About the Bow

    I need javascript.

    Quote Originally Posted by DanInMA
    why iframes, why not jsut use ajax calls instead?
    It's complicated.

  5. #5
    Join Date
    Apr 2010
    Location
    Salem,Ma
    Posts
    623
    Quote Originally Posted by gibby View Post
    Under information > Facts About the Bow

    I need javascript.



    It's complicated.
    1. You only "need" javascript because youve built dropdown menus that rely on it. this is not good.
    2. The way you are doing this is very bad for SEO reasons and search result reasons
    3. a site should alwasy be coded first to work without javascript, then enhanced with javascript also for SEO reason (example no title tags in the headers of all of your child pages), and accessibility reasons.

    4. It's ALWAYS complicated, if it was easy everyone woul ddevelop their own sites . ( could you be more specific?)

    5. loading your content via ajax will sovle your scrolling issues as the content will fill the container properly, without scroll bars.


    oh and containing your header tags in paragraphs is completely uneeded and also invalid. a header tag is already a block element so it doesnt need to be contained in a paragraph ( I know you didnt ask about this but it came up as an isue on most of your pages when I ran them trough validation)
    Last edited by DanInMA; 03-20-2012 at 03:08 PM.

  6. #6
    Join Date
    Mar 2007
    Location
    U.K.
    Posts
    1,127
    Use the framed document's onscroll event.

  7. #7
    Join Date
    Apr 2005
    Posts
    35
    DanInMA,

    I appreciate the help, but you're not taking into consideration budget contraints and client requirements.

    Quote Originally Posted by DanInMA View Post
    1. You only "need" javascript because youve built dropdown menus that rely on it. this is not good.
    The client wants drop down menus. Is there another way to do this without javascript?


    Quote Originally Posted by DanInMA View Post
    4. It's ALWAYS complicated, if it was easy everyone woul ddevelop their own sites . ( could you be more specific?)
    Budget contraints for one: I don't have time to re-develop the site to use AJAX calls and divs (although I will certainly consider this for next time).

    Quote Originally Posted by DanInMA View Post
    5. loading your content via ajax will sovle your scrolling issues as the content will fill the container properly, without scroll bars.
    The client wants scrolling for the content pane. Rebuilding the whole infrastructure of the site is not in the budget. Also, doesn't AJAX use javascript?

    Quote Originally Posted by DanInMA View Post
    oh and containing your header tags in paragraphs is completely uneeded and also invalid. a header tag is already a block element so it doesnt need to be contained in a paragraph ( I know you didnt ask about this but it came up as an isue on most of your pages when I ran them trough validation)
    I'm interested in hearing more about this. I'm not sure what you mean by "paragraphs". What paragraphs?

    Quote Originally Posted by Logic Ali
    Use the framed document's onscroll event.
    This works if the user actually scrolls, but what if the user just clicks on the scroll bar?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles