Results 1 to 7 of 7
I am building a site for a mate in HTML, and He wants images to open in new windows. I know this can be done by
Code:
<a href="path/to/image.jpg" target="_blank">
...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 02-29-2004 #1
HTML Help
I am building a site for a mate in HTML, and He wants images to open in new windows. I know this can be done by
But is there a way to set the size of the new window to a set size?Code:<a href="path/to/image.jpg" target="_blank"> [img]path/to/thuimbnail.jpg[/img]</a>
"I am not an alcoholic, alcoholics go to meetings"
Registered Linux user = #372327
- 02-29-2004 #2Linux Engineer
- Join Date
- Jul 2003
- Location
- Farnborough, UK
- Posts
- 1,305
Sounds like a job for javascript to me. Dunno what the command is but if you can find a site that does what you want to do then just look in the status bar when you hover over a link.
- 03-01-2004 #3
ok! Cool! If anyone sees a site like this and remembers if u could post the address, or how it works?
Thanx!"I am not an alcoholic, alcoholics go to meetings"
Registered Linux user = #372327
- 03-01-2004 #4Linux Engineer
- Join Date
- Jul 2003
- Location
- Farnborough, UK
- Posts
- 1,305
This any good?
http://www.htmlgoodies.com/beyond/openwin.html
Or this?
http://www.codetoad.com/forum/15_22904.asp
- 03-10-2004 #5Linux User
- Join Date
- Jan 2003
- Location
- Cardiff, Wales
- Posts
- 478
script
I always use this:
Javascript function put it in the HTML HEAD
Then use it like thisCode:<script language="Javascript" type="text/javascript"> <!-- function openWindow(path, windowname, w, h) { // Name the Window, so the remote can target it - if required self.name = "Master_Window"; // determine center of screen if (screen.width) { // IE var xMax = screen.width; var yMax = screen.height; } else { if (window.outerWidth) { // mozilla var xMax = window.outerWidth; var yMax = window.outerHeight; } else { // Catch all var xMax = 640; var yMax=480; } } var xOffset = (xMax - w)/2; var yOffset = (yMax - h)/2; var opts = "scrollbars=no,resizable=no,width=" + w + ",height=" + h + ",left=" + xOffset + ",top=" + yOffset +",screenX=" + xOffset + ",screenY=" + yOffset; // open it and maintain a var to it var Child = window.open(path, windowname, opts); } //--> </script>
Code:my link
No trees were harmed during the creation of this message. Its made from a blend of elephant tusk and dolphin meat.
- 03-10-2004 #6Linux Engineer
- Join Date
- Mar 2003
- Location
- U.S.A.
- Posts
- 1,025
So what would be a solution for the browsers that are not javascript friendly?
Is there a way to do what the users want in html or php?Dan
\"Keep your friends close and your enemies even closer\" from The Art of War by Sun Tzu\"
- 03-10-2004 #7Linux User
- Join Date
- Jan 2003
- Location
- Cardiff, Wales
- Posts
- 478
no javascript
in pure html all you can do is use _new or _blank as the target for the anchor.
I suppose you could write a php function that tests $_SERVER['HTTP_USER_AGENT'] and then writes a different link depending on the answer but that could be complex.
There is also a PHP function called get_browser. this returns an associate array detailing what the browser can support. However, to use this you need to setup a file called browsecap.ini - which I have not done.
What browsers are you thinking of? general old browsers or text based ones like lynx?[/code]No trees were harmed during the creation of this message. Its made from a blend of elephant tusk and dolphin meat.


Reply With Quote
