RE: JS Rollover Not Opening New Browser Window
Hi, Matt...no offense taken whatsoever..(not enough time or energy to be wasted in this world by taking offense at needing or getting help or an ego that prevents me from realizing or getting the help I do need!) Anyway..I figured out what the problem was...and you're right that it's not the javascript that's handling the new window, it would be the a href tag, the HTML. (I think that's an accurate view) The problem came when the HTML was rendered with a space before the Target=_blank part. The browser was making it a href=http://www.fl.living.net/idxfirm/3087550%20Target=_blank; ... As soon as I removed the blank space before Target, 3087550Target=_blank, it worked fine...not sure why but at least it solved the problem. The space doesn't affect other links using the space before Target=_blank, but it does keep this one from opening a new window. Thanks for the work on the code...I'll keep that hand for future use. Rick -Original Message- From: Matt Williams [mailto:[EMAIL PROTECTED] Sent: Saturday, November 04, 2006 12:27 AM To: CF-Talk Subject: Re: JS Rollover Not Opening New Browser Window Rick, I don't mean to offend in any way, but you did say your javascript was generated. Honestly I don't see how your javascript does anything. Here's a simple example of how you can do a link with an image. When you mouse over the image, it changes to the 02 version of the image. When you mouse off, it goes back to 01. When you mouse over the image and click on it, it will first change as described above based on the onMouseOver javascript event. The a href tag handles opening the link in a new window (based on target=_blank). The main difference in what I have here is that the onMouseOver and onMouseOut event calls are in the img tag, not the a href tag. Also the this.id part is case sensitive, so this.ID won't work. script type=text/javascript!-- function switchImage(imgID, imgSrc) { document.getElementById(imgID).src = imgSrc; } //--/script a href=http://www.fl.living.net/idxfirm/3087550; Target=_blank img id=PictureRollover36 height=21 width=170 src=./Florida_Properties_01.jpg border=0 alt= onMouseOver=switchImage(this.id,'./Florida_Properties_02.jpg') onMouseOut=switchImage(this.id,'./Florida_Properties_01.jpg') / /a Hope this helps. Matt ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:259161 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: JS Rollover Not Opening New Browser Window
What do the js functions - onPictureRollover36A3260Over() - have in them? Maybe I don't fully understand what you want, but javascript isn't going to look at target=_blank. To get javascript to open a new window, you want something like window.open('filename.cfm',some,parameters,such,as,width,height,etc) Matt On 11/3/06, Rick Faircloth [EMAIL PROTECTED] wrote: I've got this code.why won't it open a new browser window? a href=http://www.fl.living.net/idxfirm/3087550; Target=_blank onMouseOver=onPictureRollover36A3260Over(this) onMouseOut=onPictureRollover36A3260Out(this)IMG ID=PictureRollover36 HEIGHT=21 WIDTH=170 SRC=./Florida_Properties_01.jpg BORDER=0 ALT= name=PictureRollover36A3260/a The Target=_blank works fine in a regular link, but not in this rollover code. Why? Thanks, Rick ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:259140 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: JS Rollover Not Opening New Browser Window
Thanks for the reply, Matt... I've pasted in the entire script and the previous line of code I sent that references it. How can I modify this code to include the window.open function in the HTML? function onClick or something? (As you can tell, I am *not* a JS coder...this was generated for me) Rick script type=text/javascript!-- function onPictureRollover36A3380Over() {} function onPictureRollover36A3380Out() {} //--/script script type=text/javascript!-- graphic1PictureRollover36A3380 = new Image() graphic1PictureRollover36A3380.src = './Florida_Properties_01.jpg'; graphic2PictureRollover36A3380 = new Image() graphic2PictureRollover36A3380.src = './Florida_Properties_02.jpg'; function onPictureRollover36A3380Over() { document.PictureRollover36A3380.src=graphic2PictureRollover36A3380.src; } function onPictureRollover36A3380Out() { document.PictureRollover36A3380.src=graphic1PictureRollover36A3380.src; } //--/script a href=http://www.fl.living.net/idxfirm/3087550; Target=_blank onMouseOver=onPictureRollover36A3260Over(this) onMouseOut=onPictureRollover36A3260Out(this)IMG ID=PictureRollover36 HEIGHT=21 WIDTH=170 SRC=./Florida_Properties_01.jpg BORDER=0 ALT= name=PictureRollover36A3260/a -Original Message- From: Matt Williams [mailto:[EMAIL PROTECTED] Sent: Friday, November 03, 2006 3:47 PM To: CF-Talk Subject: Re: JS Rollover Not Opening New Browser Window What do the js functions - onPictureRollover36A3260Over() - have in them? Maybe I don't fully understand what you want, but javascript isn't going to look at target=_blank. To get javascript to open a new window, you want something like window.open('filename.cfm',some,parameters,such,as,width,height,etc) Matt On 11/3/06, Rick Faircloth [EMAIL PROTECTED] wrote: I've got this code.why won't it open a new browser window? a href=http://www.fl.living.net/idxfirm/3087550; Target=_blank onMouseOver=onPictureRollover36A3260Over(this) onMouseOut=onPictureRollover36A3260Out(this)IMG ID=PictureRollover36 HEIGHT=21 WIDTH=170 SRC=./Florida_Properties_01.jpg BORDER=0 ALT= name=PictureRollover36A3260/a The Target=_blank works fine in a regular link, but not in this rollover code. Why? Thanks, Rick ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:259141 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: JS Rollover Not Opening New Browser Window
Rick, these scripts don't open a popup window, but rather change the source of the image with the id 'PictureRollover36A3380' (maybe). You are passing an argument (this) into functions that don't take arguments (but probably should), and a popup window without having to click on a link or button is going to set off every popup blocker on every browser. You would want something like function changeThisPic(id){ imgObj = document.getElementById(id); imgObj.src = eval('graphic' + id +'.src'); } Or something similar (my syntax is probably off), which would still only be used for changing the source of a specific image ID, not for opening a popup. Cutter http://blog.cutterscrossing.com Rick Faircloth wrote: Thanks for the reply, Matt... I've pasted in the entire script and the previous line of code I sent that references it. How can I modify this code to include the window.open function in the HTML? function onClick or something? (As you can tell, I am *not* a JS coder...this was generated for me) Rick script type=text/javascript!-- function onPictureRollover36A3380Over() {} function onPictureRollover36A3380Out() {} //--/script script type=text/javascript!-- graphic1PictureRollover36A3380 = new Image() graphic1PictureRollover36A3380.src = './Florida_Properties_01.jpg'; graphic2PictureRollover36A3380 = new Image() graphic2PictureRollover36A3380.src = './Florida_Properties_02.jpg'; function onPictureRollover36A3380Over() { document.PictureRollover36A3380.src=graphic2PictureRollover36A3380.src; } function onPictureRollover36A3380Out() { document.PictureRollover36A3380.src=graphic1PictureRollover36A3380.src; } //--/script a href=http://www.fl.living.net/idxfirm/3087550; Target=_blank onMouseOver=onPictureRollover36A3260Over(this) onMouseOut=onPictureRollover36A3260Out(this)IMG ID=PictureRollover36 HEIGHT=21 WIDTH=170 SRC=./Florida_Properties_01.jpg BORDER=0 ALT= name=PictureRollover36A3260/a -Original Message- From: Matt Williams [mailto:[EMAIL PROTECTED] Sent: Friday, November 03, 2006 3:47 PM To: CF-Talk Subject: Re: JS Rollover Not Opening New Browser Window What do the js functions - onPictureRollover36A3260Over() - have in them? Maybe I don't fully understand what you want, but javascript isn't going to look at target=_blank. To get javascript to open a new window, you want something like window.open('filename.cfm',some,parameters,such,as,width,height,etc) Matt On 11/3/06, Rick Faircloth [EMAIL PROTECTED] wrote: I've got this code.why won't it open a new browser window? a href=http://www.fl.living.net/idxfirm/3087550; Target=_blank onMouseOver=onPictureRollover36A3260Over(this) onMouseOut=onPictureRollover36A3260Out(this)IMG ID=PictureRollover36 HEIGHT=21 WIDTH=170 SRC=./Florida_Properties_01.jpg BORDER=0 ALT= name=PictureRollover36A3260/a The Target=_blank works fine in a regular link, but not in this rollover code. Why? Thanks, Rick ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:259142 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: JS Rollover Not Opening New Browser Window
Hi, Cutter...thanks for the feedback. I can open a popup without any problem, but can't open the target site in a new browser window...the rollover works fine, too. I guess I need another function specifically to open a new browser window when the roll-over image is clicked? Rick -Original Message- From: Cutter (CFRelated) [mailto:[EMAIL PROTECTED] Sent: Friday, November 03, 2006 4:27 PM To: CF-Talk Subject: Re: JS Rollover Not Opening New Browser Window Rick, these scripts don't open a popup window, but rather change the source of the image with the id 'PictureRollover36A3380' (maybe). You are passing an argument (this) into functions that don't take arguments (but probably should), and a popup window without having to click on a link or button is going to set off every popup blocker on every browser. You would want something like function changeThisPic(id){ imgObj = document.getElementById(id); imgObj.src = eval('graphic' + id +'.src'); } Or something similar (my syntax is probably off), which would still only be used for changing the source of a specific image ID, not for opening a popup. Cutter http://blog.cutterscrossing.com Rick Faircloth wrote: Thanks for the reply, Matt... I've pasted in the entire script and the previous line of code I sent that references it. How can I modify this code to include the window.open function in the HTML? function onClick or something? (As you can tell, I am *not* a JS coder...this was generated for me) Rick script type=text/javascript!-- function onPictureRollover36A3380Over() {} function onPictureRollover36A3380Out() {} //--/script script type=text/javascript!-- graphic1PictureRollover36A3380 = new Image() graphic1PictureRollover36A3380.src = './Florida_Properties_01.jpg'; graphic2PictureRollover36A3380 = new Image() graphic2PictureRollover36A3380.src = './Florida_Properties_02.jpg'; function onPictureRollover36A3380Over() { document.PictureRollover36A3380.src=graphic2PictureRollover36A3380.src; } function onPictureRollover36A3380Out() { document.PictureRollover36A3380.src=graphic1PictureRollover36A3380.src; } //--/script a href=http://www.fl.living.net/idxfirm/3087550; Target=_blank onMouseOver=onPictureRollover36A3260Over(this) onMouseOut=onPictureRollover36A3260Out(this)IMG ID=PictureRollover36 HEIGHT=21 WIDTH=170 SRC=./Florida_Properties_01.jpg BORDER=0 ALT= name=PictureRollover36A3260/a -Original Message- From: Matt Williams [mailto:[EMAIL PROTECTED] Sent: Friday, November 03, 2006 3:47 PM To: CF-Talk Subject: Re: JS Rollover Not Opening New Browser Window What do the js functions - onPictureRollover36A3260Over() - have in them? Maybe I don't fully understand what you want, but javascript isn't going to look at target=_blank. To get javascript to open a new window, you want something like window.open('filename.cfm',some,parameters,such,as,width,height,etc) Matt On 11/3/06, Rick Faircloth [EMAIL PROTECTED] wrote: I've got this code.why won't it open a new browser window? a href=http://www.fl.living.net/idxfirm/3087550; Target=_blank onMouseOver=onPictureRollover36A3260Over(this) onMouseOut=onPictureRollover36A3260Out(this)IMG ID=PictureRollover36 HEIGHT=21 WIDTH=170 SRC=./Florida_Properties_01.jpg BORDER=0 ALT= name=PictureRollover36A3260/a The Target=_blank works fine in a regular link, but not in this rollover code. Why? Thanks, Rick ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:259143 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: JS Rollover Not Opening New Browser Window
Rick, I don't mean to offend in any way, but you did say your javascript was generated. Honestly I don't see how your javascript does anything. Here's a simple example of how you can do a link with an image. When you mouse over the image, it changes to the 02 version of the image. When you mouse off, it goes back to 01. When you mouse over the image and click on it, it will first change as described above based on the onMouseOver javascript event. The a href tag handles opening the link in a new window (based on target=_blank). The main difference in what I have here is that the onMouseOver and onMouseOut event calls are in the img tag, not the a href tag. Also the this.id part is case sensitive, so this.ID won't work. script type=text/javascript!-- function switchImage(imgID, imgSrc) { document.getElementById(imgID).src = imgSrc; } //--/script a href=http://www.fl.living.net/idxfirm/3087550; Target=_blank img id=PictureRollover36 height=21 width=170 src=./Florida_Properties_01.jpg border=0 alt= onMouseOver=switchImage(this.id,'./Florida_Properties_02.jpg') onMouseOut=switchImage(this.id,'./Florida_Properties_01.jpg') / /a Hope this helps. Matt 11/3/06, Rick Faircloth [EMAIL PROTECTED] wrote: Rick Faircloth wrote: Thanks for the reply, Matt... I've pasted in the entire script and the previous line of code I sent that references it. How can I modify this code to include the window.open function in the HTML? function onClick or something? (As you can tell, I am *not* a JS coder...this was generated for me) Rick script type=text/javascript!-- function onPictureRollover36A3380Over() {} function onPictureRollover36A3380Out() {} //--/script script type=text/javascript!-- graphic1PictureRollover36A3380 = new Image() graphic1PictureRollover36A3380.src = './Florida_Properties_01.jpg'; graphic2PictureRollover36A3380 = new Image() graphic2PictureRollover36A3380.src = './Florida_Properties_02.jpg'; function onPictureRollover36A3380Over() { document.PictureRollover36A3380.src=graphic2PictureRollover36A3380.src; } function onPictureRollover36A3380Out() { document.PictureRollover36A3380.src=graphic1PictureRollover36A3380.src; } //--/script a href=http://www.fl.living.net/idxfirm/3087550; Target=_blank onMouseOver=onPictureRollover36A3260Over(this) onMouseOut=onPictureRollover36A3260Out(this)IMG ID=PictureRollover36 HEIGHT=21 WIDTH=170 SRC=./Florida_Properties_01.jpg BORDER=0 ALT= name=PictureRollover36A3260/a ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:259154 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4