SitePoint Sponsor

User Tag List

Results 1 to 13 of 13

Thread: Can I do this?

  1. #1
    Skills to Pay the Bills Sparkie's Avatar
    Join Date
    Jul 1999
    Location
    A cave with 47 computers and an internet feed
    Posts
    3,559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can I do this?

    ok, I have the following javascript in a page I'm doing:

    <A href="index.html" ONMOUSEOVER="popup('Text goes here, blah blah blah','yellow')"; ONMOUSEOUT="kill()" >

    Is there a way to put a link inside of the part where it says 'Text goes here.....etc." And if so, how can I do it?

  2. #2
    pg for mild peril cow's Avatar
    Join Date
    Mar 2000
    Location
    nevada, usa
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    as far as i know, you can only open a url in a new window not a link...you'd have to open a page containing that link in the new window, but that would totally defeat the purpose of that dynamic link.
    "There's no justice like angry mob justice!" --Seymour Skinner

  3. #3
    Happy Holidays !! Paul S's Avatar
    Join Date
    Mar 2001
    Location
    Mexico
    Posts
    1,287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes you can, but it would not work as you want. Why? Picture this: the user puts the mouse cursor over the link, then a new window pops up (with the url inside) but as soon as the user want to click that url the ONMOUSEOUT event would be called and pow!! no more url and window leaving the user confused and frustrated.

    Just remove the OnmouseOut event, include a link inside the new windows to close it and leave the part

    .. ONMOUSEOVER="popup('Text <a href=\'your_link_here\'>goes here</a>, blah blah blah','yellow');">

    (I'm assumming that popup() prints the text passed as parameter in the new window)

  4. #4
    pg for mild peril cow's Avatar
    Join Date
    Mar 2000
    Location
    nevada, usa
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Paul S
    (I'm assumming that popup() prints the text passed as parameter in the new window)
    how would you do that? can you post that code? i'd like to see how that works!
    "There's no justice like angry mob justice!" --Seymour Skinner

  5. #5
    I am the night... bman's Avatar
    Join Date
    Mar 2001
    Location
    In a van... down by the river.
    Posts
    366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    do you have a the function popup() created anywhere? what does it do?
    Some say the world will end in fire, Some say in ice.
    From what I've tasted of desire
    I hold with those who favor fire.

  6. #6
    Happy Holidays !! Paul S's Avatar
    Join Date
    Mar 2001
    Location
    Mexico
    Posts
    1,287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by cow
    how would you do that? can you post that code? i'd like to see how that works!
    Sure it works, I posted here a similar function a couple of month ago. Let me write an example.

  7. #7
    Skills to Pay the Bills Sparkie's Avatar
    Join Date
    Jul 1999
    Location
    A cave with 47 computers and an internet feed
    Posts
    3,559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Paul S


    Just remove the OnmouseOut event, include a link inside the new windows to close it and leave the part

    Dont understand what you mean when you say "the new windows to close it..." A link inside the popup script to close the window?
    Sherice Jacob - Web Improvement Expert
    Improve Website Conversions | eBook Covers
    Follow Me on Twitter!

  8. #8
    Happy Holidays !! Paul S's Avatar
    Join Date
    Mar 2001
    Location
    Mexico
    Posts
    1,287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I mean, You have onmouseout=kill(), so what's kill() purpose, destroy the pop up window?

  9. #9
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that IS what he is saying Sparkie. Put a link inside the popup to close it.

    Sketch
    Aaron Brazell
    Technosailor



  10. #10
    Happy Holidays !! Paul S's Avatar
    Join Date
    Mar 2001
    Location
    Mexico
    Posts
    1,287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Sketch
    that IS what he is saying Sparkie. Put a link inside the popup to close it.
    No he's asking if the can put ANY link inside the window.

  11. #11
    Happy Holidays !! Paul S's Avatar
    Join Date
    Mar 2001
    Location
    Mexico
    Posts
    1,287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok cow, here's the code:
    Code:
    <a href="index.html" onmouseover="paul_popup('This is a really nice popup window :) Check this <a href=\'http://www.sitepointforums.com/showthread.php?s=&threadid=36568#newpost\'>This thread</a>');">link</a>
    and the magic function is
    Code:
     function paul_popup(text) {
       var wpop = window.open('','','width=550,height=400,scrollbars=yes');
       wpop.document.open();
       wpop.document.write(text);
     }
    Have fun !! :)
    Paul

  12. #12
    Happy Holidays !! Paul S's Avatar
    Join Date
    Mar 2001
    Location
    Mexico
    Posts
    1,287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so Sparkie, is that what you want to do?

    Paul

  13. #13
    Skills to Pay the Bills Sparkie's Avatar
    Join Date
    Jul 1999
    Location
    A cave with 47 computers and an internet feed
    Posts
    3,559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Right on, Paul! It works great!! Thank you very very much for your help!


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
  •