Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Chacala_Nayarit

macrumors 6502
Original poster
Oct 6, 2005
315
0
Lakewood, Washington
This tested fine in Firefox, but IE 6 does not render. Meaning when the photos are clicked they do not open in a new window. http://rainiersupply.com/gallery.html


Code:
<ul id="albumlist">
	<li><a href="javascript:void(0)" onclick="window.open('/images/500ftMCM.jpg','http://rainiersupply.com','width=500,height=375')"><img src="/thumbnails/500ftMCM.jpg" alt="500ftMCM" width="144" height="108" />500ft MCM</a></li>

IE 6 displays an error in the corner of the browser says something like invalid argument line: {every picture}, Code: 0, blah, blah, blah... :mad:

Where did I go wrong? Is there a better way to achieve this goal?
 
I'm not in frpnt of a PC at the moment but I don't think IE6 PC likes void(0);

So (as an example) replace

Code:
<a href="javascript:void(0)" onclick="window.open('/images/500ftMCM.jpg','http://rainiersupply.com','width=500,height=375')"><img src="/thumbnails/500ftMCM.jpg" alt="500ftMCM" width="144" height="108" />500ft MCM</a>

with

Code:
<a href="window.open('/images/500ftMCM.jpg','http://rainiersupply.com','width=500,height=375')"><img src="/thumbnails/500ftMCM.jpg" alt="500ftMCM" width="144" height="108" />500ft MCM</a>
 
Unfortunately the above code does not work. I just put an image link to get Firefox. So if they want to view the pictures, well than they have too download Firefox.:p
 
Hmm.. try this:
Code:
<a href="#" onclick="window.open('/images/500ftMCM.jpg','http://rainiersupply.com','width=500,height=375')"><img src="/thumbnails/500ftMCM.jpg" alt="500ftMCM" width="144" height="108" />500ft MCM</a>
 
This will work:

Code:
<a href="javascript:window.open('/images/500ftMCM.jpg','http://rainiersupply.com','width=500,height=375')"><img src="/thumbnails/500ftMCM.jpg" alt="500ftMCM" width="144" height="108" />500ft MCM</a>
 
The way I normally do new windows in javascript is: (untested)

Code:
<a href="/images/500ftMCM.jpg" target="_blank" onClick="window.open(this.href, 'new', 'width=500,height=375');return false;"><img src="/thumbnails/500ftMCM.jpg" alt="500ftMCM" width="144" height="108" />500ft MCM</a>

This means that browsers without javascript enabled will work as normal, opening the image in a full size window.
 
Just a remark on the side:

Although your javascript says 'width=500,height=375' and your image all are 500 x 375 the new window that opens always has scrollbars when i open them.

The actual part of the image shown is 485 x 359.
Shouldn't Safari (2.0.3) just show the image if it fits, it's by putting those bars that you need them.

Couldn't come up with a tag for forcing 'no scrollbars' on a new window, then again i really didn't look so hard.

Firefox (Mac and PC) and camino show the image in a window bigger than the set size.

Anyhow, i'm sorry for this OT post.

Cheers
 
Knox said:
The way I normally do new windows in javascript is: (untested)

Code:
<a href="/images/500ftMCM.jpg" target="_blank" onClick="window.open(this.href, 'new', 'width=500,height=375');return false;"><img src="/thumbnails/500ftMCM.jpg" alt="500ftMCM" width="144" height="108" />500ft MCM</a>

This means that browsers without javascript enabled will work as normal, opening the image in a full size window.

Thank you! that's the one that works! I changed a few of them, but I stopped until the billing starts at 8:00am tomorrow. :D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.