Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: DIV functions

  1. #1
    Join Date
    Nov 2007
    Location
    London
    Posts
    1,577
    Tokens
    36

    Latest Awards:

    Default DIV functions

    Hello,

    I currently have a website with some content in a DIV. The content in the DIV is a code that will link to a different site, and changes every so often but not by me. I need it so that when of one of the links inside it are clicked, it opens the link and does a javascript function. So far, the best I can do is putting the html code in a DIV and making the "onmouseout" of the div run the javascript function. However, this does not work well in firefox and people are just moving their mouse over and away from the div instead of clicking the links. Is there a better way of doing this, ie. onclick command to run the javascript function?

    Successfuly helpers will receive +rep as thanks.

    Thanks in advance.
    Kind Regards,

    Guy
    __________________

    Since 2007. Unbelievable Uptime. Web hosting, resellers, master resellers, linux VPS, windows VPS, shoutcasts, at the lowest prices on the net.
    Tech-Hosts.co.uk.


  2. #2
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    in the a href use onrelease i think
    How could this hapen to meeeeeeeeeeeeeee?lol.

  3. #3
    Join Date
    Nov 2007
    Location
    London
    Posts
    1,577
    Tokens
    36

    Latest Awards:

    Default

    Will try onrelease instead of onmouseout - one second thanks.

    Edit: Nope, nothing happens now.

    Edit2: Just found a command "ondblclick", what does this do? Might it work where onclick doesn't?

    Edit3: Oh, it's just on double click.

    By the way, onclick doesn't work. This would definitely be the most practicle. Is there possibly something I could put in CSS, and make the div have an ID/class?
    Last edited by iUnknown; 29-02-2008 at 10:31 PM.
    Kind Regards,

    Guy
    __________________

    Since 2007. Unbelievable Uptime. Web hosting, resellers, master resellers, linux VPS, windows VPS, shoutcasts, at the lowest prices on the net.
    Tech-Hosts.co.uk.


  4. #4
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    2,016
    Tokens
    141
    Habbo
    florx

    Latest Awards:

    Default

    Lets see the site and we might be able to help you

  5. #5
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    HTML Code:
    <a href="page.php" onmousedown="function();" onclick="function2();">lol</a>
    :S ?

  6. #6
    Join Date
    Nov 2007
    Location
    London
    Posts
    1,577
    Tokens
    36

    Latest Awards:

    Default

    *removed by me*

    Quote Originally Posted by Invent View Post
    HTML Code:
    <a href="page.php" onmousedown="function();" onclick="function2();">lol</a>
    :S ?
    It's a challenge due to the content inside the DIV, it's not any ordinary link.
    Last edited by iUnknown; 29-02-2008 at 10:35 PM.
    Kind Regards,

    Guy
    __________________

    Since 2007. Unbelievable Uptime. Web hosting, resellers, master resellers, linux VPS, windows VPS, shoutcasts, at the lowest prices on the net.
    Tech-Hosts.co.uk.


  7. #7
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    URL please as I don't understand what's so complicated.

  8. #8
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Oh sorry guy, i said id look at this for you..

    Give me 2 secs.

    Just checking the code on my server, as i think its your javascript thats stopping the onclick from functioning.
    then il pm you code when done..
    Last edited by MrCraig; 29-02-2008 at 10:51 PM.
    Coming and going...
    Highers are getting the better of me

  9. #9
    Join Date
    Nov 2007
    Location
    London
    Posts
    1,577
    Tokens
    36

    Latest Awards:

    Default

    Quote Originally Posted by MrCraig View Post
    Oh sorry guy, i said id look at this for you..

    Give me 2 secs.

    Just checking the code on my server, as i think its your javascript thats stopping the onclick from functioning.
    then il pm you code when done..
    Thanks Craig, once again ^^
    Kind Regards,

    Guy
    __________________

    Since 2007. Unbelievable Uptime. Web hosting, resellers, master resellers, linux VPS, windows VPS, shoutcasts, at the lowest prices on the net.
    Tech-Hosts.co.uk.


  10. #10
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    nps, just waiting for brute force protection to unlock me... :|
    Coming and going...
    Highers are getting the better of me

Page 1 of 3 123 LastLast

Posting Permissions

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