Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onmouseup if then browser detection 1

Status
Not open for further replies.

tellersix

Programmer
Oct 19, 2003
23
US
i have a gallery page where each thumbnail opens a larger image in it's own pop up window. that part works fine onmouseup the new window opens to the exact size of the image it contains. ( i know somepeople find this annoying, but i need each image to be it's own object, trust me it doesn't suck.) except the problem is IE works but NS crops the image. the proportions are understood differently by each. so i need a code that will detect the browser when the thumbnail is clicked and open the image.html in a window that is one size for IE and one size for NS. i understand the seperate pieces of code involved but i am having trouble merging them. thanks
 
Use your browser detection script onload for the main page to set a variable.

Then when you do your popup routine you test the value of the variable and use the appropriate script.

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.

AU.gif
Check out Tek-Tips Australia New Zealand forum1155
NZ.gif
 
thanks but i need a little more in depth information, i am a beginer.
 
i think my first post was too wordy and did not convey my true lack of knowledge. so here is the function i desire in lay man's terms.

i need code that does this:

on mouse up check browser. if internet explorer, open example.html in new window with dimentions 100 by 200. if netscape navigator, open example.html in a new window with dimentions 300 by 400.

please help me
 
beebumble,
Code:
function cknav(){
navnm = navigator.appName;
 if(navnm.indexOf('Netscape') != -1){
      netscape = true; }
 else {
  netscape = false; }
}

<body onLoad=&quot;cknav()&quot;>

then in your popup funtion include:
Code:
if(!netscape){
.....
...
do your IE stuff  }
else {
......
..
do your Netscape stuff  }

Also, might be helpful to you to go to and do search--> javascript navigator.appName

You shout back if this needs more explanation or adjustment.




2b||!2b
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top