SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    thickbox - rollover not onclick - is it possible?

    Before I start going through code line by line - I wondered if anyone had done this yet

    thickbox - http://jquery.com/demo/thickbox/

    is a fab peice of code that you can use to highlight items on your webpage - the only issue I have so far is that you have to CLICK something to view the thickbox, I wondered if it can be altered to work as a rollover - prety much like the lightbox does on iSTOCK

    Before I trawled through code I just thought that I would see if anyone knew

    Thanks
    Sarah
    Regular user

  2. #2
    SitePoint Addict jtrelfa's Avatar
    Join Date
    Oct 2004
    Location
    Troy, Mi
    Posts
    231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you look at the first part of the thickbox.js file, there's a function called TB_init():
    Code:
    function TB_init(){
      $("a.thickbox").click(function(){
        var t = this.title || this.name || null;
        var g = this.rel || false;
        TB_show(t,this.href,g);
        this.blur();
        return false;
      });
    }
    This command is automatically run on "document.ready". You could intercept/re-write that function and substitute the ".click" with ".hover".

    With .hover, you provide 2 function definitions; the first is for mouseover, the second for mouseout.

    So....it's possible to do it with a rollover, but you'll still need to slog through at least part of the thickbox code to make it work the way you want.

  3. #3
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    thank you for your reply - I actually used an image for now whilst I trawl through the code!! not something I am looking for - thank you though
    Regular user


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
  •