View Full Version : Pop up window and mouseover image effect.
jkhosa
09-24-2002, 05:35 AM
I had read the thread here in this forum before with a similar question, but I was'nt able to learn anything from it. I know very little about Java Script. My level of understanding is only up to cut and paste.
My goal is to post three links to page one and add a pop up window as a hyperlink. Now I want to have three thumbnale-images on that pop up page, and then I want to have a ,mouse over effect on those thumnales.
Reason for all this is that I want to restrict an average visitor of that page from downloading those three images.
I also know how to disable right click but I guess that is not enough.
Please help.
A1ien51
09-24-2002, 05:53 AM
okay, hiding an image will do crap, but here you go
<img src="blah.gif" width=100" height="100" onmouseover="this.src='NewImagae.gif'" onmouseout="this.src='blah.gif'">
right click does not work for left handed people.....lol
lets se here,,,,,,,what else do you want done??
beetle
09-24-2002, 06:05 AM
Originally posted by A1ien51
right click does not work for left handed people.....lol Wait...do you really mean that? Or is it a joke? Cuz that is NOT true....
jkhosa
09-24-2002, 06:10 AM
OKie ,
First thanks for your replies.
Now please tell me how to open a link in new window having the window maximise disabled. Or how to specify the size of the new window.
tommysphone
09-24-2002, 03:08 PM
this serves me well.
Put in <head> tag
<script language="JavaScript">
function MM_openBrWindow(theURL,winName,features) {
window.open(theURL,winName,features);
}
</script>
Put in the body tag where you want the link to be
<a href="javascript:;"
onClick="MM_openBrWindow('http://url/filename.htm','window','scrollbars=yes,width=425,height=250')">
<p>Link name</a>
Note:
scrollbars=yes - Change to no for no scroll bars
width=425,height=250 - Change accordingly
Hope thats useful.
beetle
09-24-2002, 03:36 PM
Not that it doesn't work, but that MM_openBrWindow() function is a waste of code. Think about it. It's a function with 3 parameters that runs just 1 line of code that is a method (read: function) with 3 parameters. So, what's it's purpose? I'm not really sure, but it seems to have been developed by the Department of Redundancy Department over at Macromedia.
In short, skip the MM function and just use the window.open method.<a href="page.htm" onClick="return false; window.open(this.href,'winName','scrollbars=yes,width=425,height=250');">Link</a>To learn more about the open method, click here (http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_1.asp) or here (http://www.mozilla.org/docs/dom/domref/dom_window_ref76.html#1019331)
vkidv
09-24-2002, 07:41 PM
would'nt it depend how many pop windows you want, right?
you'd use the funciton one for loads of popups and beetl's one for like 1 or 2...
right ?
beetle
09-24-2002, 08:11 PM
Originally posted by vkidv
would'nt it depend how many pop windows you want, right?
you'd use the funciton one for loads of popups and beetl's one for like 1 or 2...
right ? No. There seems to be a misconception here that adding the function somehow increases efficiency. In most cases, that is true, but here it acutally reduces efficiency. Take a look at this:MM_openBrWindow('page.htm','myWin','width=425,height=250');
window.open('page.htm','myWin','width=425,height=250'); See? There's no difference in how you call the function/method (a method IS a function that has been attached to an object, in this case window)
So, using the MM way means that you have to include the function code (wasted HTML space), pass it 3 parameters (wasted variable space), for it to just run the window.open method anyway (wasted CPU cycles)
Now, if some of the variables were going to remain constant, such as the window name, width, height, stuff like that. THEN it would be worth it to make a custom function.
Do I make my point? :D
vkidv
09-24-2002, 08:13 PM
i understand beetle :P thanx for clearing it up for me beetle :D :D :D
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.