Current location: Hot Scripts Forums » General Web Coding » JavaScript » image and onclick


image and onclick

Reply
  #1 (permalink)  
Old 08-31-05, 04:53 AM
harland harland is offline
Newbie Coder
 
Join Date: Jun 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
image and onclick

How can I do this using a image to click instead of a text link..

<a href="javascript:window.open('child.html','newwin' );window.location.href = 'newpage.html';">Click here</a>

What I need to do is open a new window while the current window changes to a new page also, all with one click of the image...
Reply With Quote
  #2 (permalink)  
Old 08-31-05, 11:23 AM
HoTDaWg's Avatar
HoTDaWg HoTDaWg is offline
Newbie Coder
 
Join Date: Aug 2005
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
It's not as hard as you think, I also needed on when I was making a gaming website. Here's the code, all you need to do is replace some of the urls and such.

Code:
<a href="WHERE YOU WANT THE CURRENT WINDOW TO GO TO" onClick="window.open('WHERE YOU WANT THE NEW WINDOW TO GO TO', 'WindowA', 'width=550,height=550,scrollbars=no resizeable=no');"> 
<h2 align="center"><img src="YOURIMAGE" height="150" width="150" style="border: 4px solid #666666;" alt="Myimage">
</font></a><br><br>
Hope this helps ,

HoTDaWg
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
JS or DHTML Need to Bring Up Small HTML Table onClick Spire2000 Script Requests 1 05-30-05 02:28 PM
Been looking everywhere, onclick text change Drip Script Requests 0 11-27-04 01:03 AM
onClick jarbig JavaScript 1 07-29-04 09:38 PM


All times are GMT -5. The time now is 10:54 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.