<a href="#"onClick="open_win( ' ' ) ; retu

  • reaper
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 05, 2005
  • Posts: 435
  • Loc: europe
  • Status: Offline

Post September 4th, 2005, 10:38 am

I want to open this window with an image instead of a text link that is activated like so:

Code: [ Download ] [ Select ]
<a href="#" onClick="open_win( ' ' ) ;return false;">Click here</a>


What kind of string do i need for this?
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post September 4th, 2005, 10:38 am

  • UPSGuy
  • Lurker ಠ_ಠ
  • Mastermind
  • User avatar
  • Joined: Jul 25, 2005
  • Posts: 2497
  • Loc: Nashville, TN
  • Status: Offline

Post September 4th, 2005, 10:40 am

<a href="#" onClick="open_win( ' ' ) ;return false;">
<img src="yourPic.gif">
</a>
I'd love to change the world, but they won't give me the source code.

Post September 4th, 2005, 1:13 pm

Just keep in mind that the <a href="#"> construct itself is amateur junk, and has side effects you most likely didn't intend, even in IE.
  • reaper
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 05, 2005
  • Posts: 435
  • Loc: europe
  • Status: Offline

Post September 4th, 2005, 1:43 pm

Quote:
Just keep in mind that the <a href="#"> construct itself is amateur junk, and has side effects you most likely didn't intend, even in IE.


Interesting, could you elaborate some more on that? What would be a better approach?

Thanks UPSGuy for your helping hand 8)
  • reaper
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 05, 2005
  • Posts: 435
  • Loc: europe
  • Status: Offline

Post September 4th, 2005, 2:05 pm

I just tried it out and it gave the same result when using the text link.

Image

As you can see the image won't show, i do my preview in FF.

Could somebody give some pointers on this one because i am real close, the pop up is showen when called on by clicking the image that you see above but offcourse this is not what i want, i do want the picture to appear and not the space that should hold the image :(
  • Harwalt
  • Novice
  • Novice
  • No Avatar
  • Joined: Aug 31, 2005
  • Posts: 32
  • Loc: Maryland
  • Status: Offline

Post September 4th, 2005, 2:45 pm

is the image saved on the server where your img source is pointing too?
  • Tannu4u
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 29, 2004
  • Posts: 455
  • Loc: India
  • Status: Offline

Post September 5th, 2005, 3:49 am

See the path of the image, there is no problem in the code, i think that u must check the image path may be that is missing from here...Bye
Amit
My Blog http://www.amityadav.name
  • reaper
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 05, 2005
  • Posts: 435
  • Loc: europe
  • Status: Offline

Post September 5th, 2005, 3:50 am

The image i saved on my desktop and i preview all my images like this... in my browser.
  • reaper
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 05, 2005
  • Posts: 435
  • Loc: europe
  • Status: Offline

Post September 5th, 2005, 3:52 am

What line stands for the image path?
Everything works fine with other images, not with the code but the images in general.
  • Tannu4u
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 29, 2004
  • Posts: 455
  • Loc: India
  • Status: Offline

Post September 5th, 2005, 4:04 am

<a href="#" onClick="open_win( ' ' ) ;return false;">
<img src="yourPic.gif">
</a>

the above code will work for u, put the programming file and the image file in the same folder :)
Amit
My Blog http://www.amityadav.name
  • reaper
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 05, 2005
  • Posts: 435
  • Loc: europe
  • Status: Offline

Post September 5th, 2005, 4:28 am

Thanks for the line my friend but this line is not the best to use, it's not very compatible with different browser types as i also have been reading somewhere else and just like trip of the tongue wrote it is junk and not worthy of using, nothing personal my friend it's just the <a href="#"> construct is not the best option to use.

I have found this code that should be the best option for opening a new window and is also compatible with non javascript supporting browsers only i'm having trouble getting the values inserted right.

This is the code:
Code: [ Download ] [ Select ]
<a href="med/DSCN2062.jpg"
onclick="MM_openBrWindow('med/DSCN2062.jpg',
'Photo','width=800,height=600'); return false;">
<img src="DSCN2062.jpg"
width="120" height="90" border="0" alt="" /></a>
  1. <a href="med/DSCN2062.jpg"
  2. onclick="MM_openBrWindow('med/DSCN2062.jpg',
  3. 'Photo','width=800,height=600'); return false;">
  4. <img src="DSCN2062.jpg"
  5. width="120" height="90" border="0" alt="" /></a>




I have a page called - page2 - and i would like the window to open at a size of 850x450 and i want an link from an image called object.gif how would i fill this in the code above, how would the code look like then?
  • Tannu4u
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 29, 2004
  • Posts: 455
  • Loc: India
  • Status: Offline

Post September 5th, 2005, 4:40 am

<a href="Javascript:" onClick="open_win('test2.html');">
<img src="object.gif">
</a>

<script>
function open_win(f)
{
amit = window.open(f,'amit','statusbar=no,width=850,height=450');
amit.focus();
}
</script>
Amit
My Blog http://www.amityadav.name
  • reaper
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 05, 2005
  • Posts: 435
  • Loc: europe
  • Status: Offline

Post September 5th, 2005, 5:30 am

Thanks for your help! Was the code i posted above not good because i noticed you posted a different code from the one i posted.
  • Tannu4u
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 29, 2004
  • Posts: 455
  • Loc: India
  • Status: Offline

Post September 5th, 2005, 5:36 am

You have picked up half of the code, so i posted this one. Is it working for u.
Amit
My Blog http://www.amityadav.name
  • reaper
  • Proficient
  • Proficient
  • User avatar
  • Joined: Apr 05, 2005
  • Posts: 435
  • Loc: europe
  • Status: Offline

Post September 5th, 2005, 5:55 am

I've just tried it out right now but it isn't working, the image still doesn't show and an additional window popped up with the title java console :shock:


Quote:
You have picked up half of the code,


Oh did i? I have to check if i can find the page again where i found the code.

I just realize i still have something in the header maybe this is the problem of conflict perhaps.
I will remove this and check back, i will also try if i can find where i found the code i picked up only half.

This should be a very good code because it is not dependant on javascript.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post September 5th, 2005, 5:55 am

Post Information

  • Total Posts in this topic: 27 posts
  • Users browsing this forum: No registered users and 182 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© Unmelted Enterprises 1998-2009. Driven by phpBB © 2001-2009 phpBB Group.