Warning: include_once(/www/templates/gt/parts/blogs/carptips/first.php) [function.include-once]: failed to open stream: No such file or directory in /www/gt/docs/carp/tips/2004/09/opening-links-in-new-window.php on line 20

Warning: include_once() [function.include]: Failed opening '/www/templates/gt/parts/blogs/carptips/first.php' for inclusion (include_path='.:/usr/local/lib/php') in /www/gt/docs/carp/tips/2004/09/opening-links-in-new-window.php on line 20

Saturday, September 11, 2004

Opening links in a new window 

CaRP gives you two ways to make links open in a new window, one of which lets you control the size of the window. The first method, which doesn't allow you to control the window size is to add the following code to the page in which you are displaying the feed:

CarpConf('linktarget',1);

The second, which allows you to control the window size is a little trickier. First, you need some JavaScript to handle the creation of a new window with a specified size (put this in the <head> section of your webpage if possible):

<script type="text/javascript">
function OpenNewsWindow(url) {
theWindow = window.open(url, "News", "directories=no, menubar=no, scrollbars=yes, status=no, toolbar=no, resizable=yes, width=600, height=400");
if (window.focus) theWindow.focus();
}
</script>


Then, use the following configuration settings to get CaRP to trigger the JavaScript when someone clicks a link (note that "image" and "date" in the first line below require CaRP Koi or CaRP Evolution, but won't hurt anything when used with CaRP GPL):

CarpConf('iorder','image,url,title,author,date,desc');
CarpConf('biurl','<a href="#" onClick="OpenNewsWindow(\'');
CarpConf('aiurl','\'); return false;">');
CarpConf('ailink','</a><br />');

// posted by Antone Roundy @ 5:15 PM

1 Comments:

By Anonymous kral oyun oyna, at December 12, 2009 7:24 AM  

thanks for the info..

Post a Comment

http://carp.docs.geckotribe.com/tips/2004/09/opening-links-in-new-window.php

This page is powered by Blogger. Isn't yours?


Warning: include_once(/www/templates/gt/parts/blogs/carptips/second.php) [function.include-once]: failed to open stream: No such file or directory in /www/gt/docs/carp/tips/2004/09/opening-links-in-new-window.php on line 62

Warning: include_once() [function.include]: Failed opening '/www/templates/gt/parts/blogs/carptips/second.php' for inclusion (include_path='.:/usr/local/lib/php') in /www/gt/docs/carp/tips/2004/09/opening-links-in-new-window.php on line 62
ARCHIVES

Warning: include_once(/www/templates/gt/parts/blogs/carptips/third.php) [function.include-once]: failed to open stream: No such file or directory in /www/gt/docs/carp/tips/2004/09/opening-links-in-new-window.php on line 69

Warning: include_once() [function.include]: Failed opening '/www/templates/gt/parts/blogs/carptips/third.php' for inclusion (include_path='.:/usr/local/lib/php') in /www/gt/docs/carp/tips/2004/09/opening-links-in-new-window.php on line 69