Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Open Link in a new window ?
quinnrd
Newbie

Posts: 1
Registered: 3/27/2003
Member Is Offline
posted on 3/27/2003 at 04:17 AM Reply With Quote
Open Link in a new window ?


I have images scrolling and would like to pop-up a new window when I detect on the image. With the following code I get "Error On Page" which does not help me much. Following is the html I am passing in through the control file. Any help would be appreciated. Thanks in advance..
code:
<html>

<head>
<script language="javascript" src="ts_files/scroll.js"></script>
</head>
<! start window popup >

<body>
<script language="JavaScript">
function newWindow(mypage,myname,w,h,features) {
if(screen.width){
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
}else{winl = 0;wint =0;}
if (winl < 0) winl = 0;
if (wint < 0) wint = 0;
var settings = 'height=' + h + ',';
settings += 'width=' + w + ',';
settings += 'top=' + wint + ',';
settings += 'left=' + winl + ',';
settings += features;
win = window.open(mypage,myname,settings);
win.window.focus();
}
</script>

<! end window popup >

<a href="JavaScript:newWindow
('feature1.html','popup',725,200,'')"alt="Featured Movie 1">
<img align="left" src="wind.jpg" alt="Featured Movie" border="0"></a>

<!--<a href="feature1.html"><img align="left" src="wind.jpg" alt="Featured " border="0"></a>-->

</body>
</html>
View User's Profile View All Posts By User U2U Member
nik


Posts:
Registered: 1/1/1970
Member Is Offline
posted on 4/1/2003 at 07:21 AM Reply With Quote

The reason of the problem you have described is that Scroller instance is built into inline frame (iframe) HTML object, consequently, variables (and functions as well) declared in parent document are not available by their original references, but with parent. prefix only. So the solution is either to specify link href as javascript:parent.newWindow(...) or just move newWindow function declaration to Scroller template (default scroll.tpl0.js) file.
View User's Profile View All Posts By User U2U Member
araczynski
Junior Member

Posts: 3
Registered: 4/1/2003
Member Is Offline
posted on 4/1/2003 at 04:05 PM Reply With Quote
.....


Any chance you'd take the time to tell me the code to add to the Scroller template file to make new windows pop up in a new browser window automatically?

TIA
Andy

Quote:
Originally posted by nik
The reason of problem you have described is that Scroller instance is
built into inline frame (iframe) HTML object, consequently, variables
(and functions as well) declared in parent document are not available
by their original references, but with parent. prefix only. So the
solution is either to specify link href as
javascript:parent.newWindow(...) or just move newWindow function
declaration to Scroller template (default scroll.tpl0.js) file.
View User's Profile View All Posts By User U2U Member
nik


Posts:
Registered: 1/1/1970
Member Is Offline
posted on 4/2/2003 at 09:03 AM Reply With Quote

What do you mean saying "automatically"?
View User's Profile View All Posts By User U2U Member
araczynski
Junior Member

Posts: 3
Registered: 4/1/2003
Member Is Offline
posted on 4/2/2003 at 02:19 PM Reply With Quote
automatically


Here's the whole story... I would love to use your scroller on our educational agency website, but the only problem is that some of the news which we woudl be scrolling contain links, which of course doesn't work too well since this is an iframe solution. So I figured I couldn't use the software because we needed to show the links in the main frame and not inside the little scroller news.

So the 2nd message above seemed to give me some hope in that some code can be placed in the scroll.tpl?.js file (or a different one) that would automatically open each link in a whole new window, or perhaps in a different frame.

Clear as mud? ;)

TIA

Quote:
Originally posted by nik
What do you mean saying "automatically"?
View User's Profile View All Posts By User U2U Member
nik


Posts:
Registered: 1/1/1970
Member Is Offline
posted on 4/3/2003 at 06:54 AM Reply With Quote

To open links in main frame just add target="_parent" to all links inside the scroller. For example: <a href="mypage.htm" target="_parent">my page</a>
View User's Profile View All Posts By User U2U Member
araczynski
Junior Member

Posts: 3
Registered: 4/1/2003
Member Is Offline
posted on 4/3/2003 at 02:14 PM Reply With Quote
.........


dagnabit, i thought i tried that :(
that was the solution, thank you very much :)

Quote:
Originally posted by nik
To open links in main frame just add target="_parent" to all links inside the scroller. For example: <a href="mypage.htm" target="_parent">my page</a>
View User's Profile View All Posts By User U2U Member
Denis La Bine
Junior Member

Posts: 4
Registered: 6/30/2003
Member Is Offline
posted on 7/11/2003 at 08:10 AM Reply With Quote
can you show us a link to this issue?


it sounds very interesting
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos:
Multiple vertical scrolling
Horizontal scrolling
Free Download Free Download
Product Documentation Documentation:
Documenation Page
Change Log
Support Forum Technical Support
Support Forum
   

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004