SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Show anchor onMouseover

    Is there a way of making an division that has an anchor move onMouseover?

    I use hidden divisions of text that appear onMouseover, but I'm worried I might be banned from search engines.

    My idea was to create a scrolling division which contained the descriptive divisions, each one below the previous.

    Instead of the mouseover changing the visibilty, I want the mouseover to bring the relevent anchor to the top of the division.

    any suggestions?
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  2. #2
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think spiders know anything about an element's css. Besides, displaying hidden div's onmouseover is a legitimate technique.

  3. #3
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks Mike.
    So it's only hidden divs that stay hidden (spider cheats) that search engines don't like?

    Anyway, what I was thinking about, if the above could be done.......
    when javascript is enabled and someone roles over a link the relevent info is shown (anchor brought to top of div). For people that haven't javascript enabled the usual <a href="#anchor"> is used. This brings up the relevant info with a click, and the info has a link to the next page.
    So javascript enabled would require a rollover and click, and no javascript would require 2 clicks...
    I hope your following......
    I can do it with a div thats not contained in another using;
    function move() {
    self.location.href="#anchor" }

    onmouseover=move
    (or something like that)
    but I can't seem to get it to work when the div is contained in another div........
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  4. #4
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Markdidj
    Thanks Mike.
    So it's only hidden divs that stay hidden (spider cheats) that search engines don't like?
    No, a spider can't know if an element will be later hidden or made visible. That would require the spider to parse your javascript, and I doubt that they take the time to do that.

    Quote Originally Posted by Markdidj
    Anyway, what I was thinking about, if the above could be done.......
    self.location.href is with respect to the document - not an individual element. It would work with an IFrame but I don't see how to make it work with a nested element.

    Perhaps someone else will have a better suggestion.

  5. #5
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Force scrollbar position

    Can I force a scroll-bar of a division to a set position?
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  6. #6
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Markdidj
    Can I force a scroll-bar of a division to a set position?
    Doh. what I was looking for was focus.
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if


Bookmarks

Posting Permissions

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