•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 391,183 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,691 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1412 | Replies: 2
![]() |
•
•
Join Date: Dec 2007
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
I've been having some problems with a little piece of Javascript. I am completely new to the language, so bear with me. What the end goal is to have a few link on the left side of a table, when the user hovers over them, there will be a thumbnail image on the right hand side that appears. This I have using this code:
but I also want that when a user clicks on the actual link, it will bring them to another webpage. Any help would be great!
<script type="text/javascript" language="javascript">
function showPic (whichpic) {
if (document.getElementById) {
document.getElementById('placeholder').src = whichpic.href;
return false;
} else {
return true;
}
}
</script>but I also want that when a user clicks on the actual link, it will bring them to another webpage. Any help would be great!
<A HREF="javascript:void(0)"
onclick="window.open('URL')">
CLICK HERE TO OPEN NEW WINDOW</A>
IN THIS WAY YOU CAN EASILY OPEN A NEW WINDOW AT THE SAME TIME WHEN USER CLICK ON THE LINK
onclick="window.open('URL')">
CLICK HERE TO OPEN NEW WINDOW</A>
IN THIS WAY YOU CAN EASILY OPEN A NEW WINDOW AT THE SAME TIME WHEN USER CLICK ON THE LINK
Last edited by innovativeatul : Dec 4th, 2007 at 5:35 am. Reason: MISTAKE IN TYPING
CORELROCKS
innovativeatul@gmail.com
innovativeatul@gmail.com
•
•
Join Date: Dec 2007
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
That worked sorta great! 
I have it now where it shows the image on the mouseover, and when you click on the link, it brings up the web page in a new window, but unfortunately it also brings up the image since the a href is linked to the image. I wasn't sure if doing the A HREF="javascript:void(0)" would work because there is no reference to what image to show.
This is the code that I have for the link:

I have it now where it shows the image on the mouseover, and when you click on the link, it brings up the web page in a new window, but unfortunately it also brings up the image since the a href is linked to the image. I wasn't sure if doing the A HREF="javascript:void(0)" would work because there is no reference to what image to show.
This is the code that I have for the link:
<a onmouseover="return showPic(this)" href="images/allservice.jpg" onclick="window.open('www.webpage.com')">Link Goes Here</a>![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
- memory management in wndows 2000 (Windows NT / 2000 / XP / 2003)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: pop window question
- Next Thread: How can I get output in a table by using the document ID?


Linear Mode