PDA

View Full Version : Is it possible to preset new popup browser to 640 x 480 pixels



countrydj
04-12-2013, 08:23 PM
1) Script Title: Ultimate Fade-in slideshow (v2.4)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

3) Describe problem: I am trying this script, which I find exceptionally good.
However, when I click on a picture and open a larger picture in a new browser, I would like it to open to a preset size of 640 x 480 pixels.

Is this possible and if so, how do I do it ???

Thanks,

John C

Beverleyh
04-12-2013, 09:04 PM
If you're hyperlinking to a standalone image file (one that isn't embedded as part of another web page) the size shown on screen will be the size (dimensions) of the actual image, unless the window is too small, and then the browser will shrink the image to fit. If this is the case, the only way to guarentee an image being shown on screen at 640 x 480 pixels is to actually resize it to those dimensions prior to putting them online.

If you need more help, or you are using a different method to link to an image, please post a link to your page.

jscheuer1
04-13-2013, 04:57 AM
I'm not sure I agree, or maybe I'm misunderstanding. In any case, if you already have Ultimate fade, and have it setup to have each image in it linked to another and each of these other images is already 640 x 480, and already opens in a new window (all that can be configured in the slideshow) and you just want to control the size of that new window, although I wouldn't recommend it, it can be done. I would recommend using a lightbox type script instead.

That said, just add this highlighted code after the on page fadeslideshow initialization:


var mygallery=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [250, 180], //width/h . . .

. . . ation (milliseconds)
descreveal: "ondemand",
togglerid: ""
})

jQuery(function($){
$('.gallerylayer a').click(function(e){
window.open(this.href, this.target, 'width=640, height=480');
e.preventDefault();
});
});

You might want to use slightly larger numbers to account for the browser's scrollbars, edges, status bar, etc. Like instead of:


'width=640, height=480'

maybe:


'width=665, height=540'

The browser cache may need to be cleared and/or the page refreshed to see changes.

If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.

Beverleyh
04-13-2013, 05:22 AM
We might be interpreting the request differently - one of us answering with regard to resizing the image, the other answering with regard to resizing the browser window.

As far as I know (on last attempt, which was a few years ago due to the now lesser practice of trying to control the size of browser windows on behalf of a user) IE browser window size can be manipulated easily but I dont remember Firefox, Opera or Safari being so predictable - at least it used to be that way - from memory, they would just open another window as another tab at full screen. Thinking on, that might be the way now too with IE since that got a tabbed interface. I haven't tried with Chrome. I'm not sure what happens with newer versions of all the browsers so I'm curious to try.

But as John previously said, its not recommended to try to manipulate the size of a browser window, or keep opening new ones; the sizing isn't guaranteed (or its difficult to predict/achieve) and it is now considered bad practise - not so bad to open new windows when linking to other/external sites, but within the same site, its a no-no - let the user decide via right-click. Of course, opening images as a new browser window causes a quandary, but typically, nowadays, webmasters will integrate a light box to eliminate the need for new windows.

I guess it boils down to what you're actually trying to achieve, so some clarification and a page link would be good.

countrydj
04-13-2013, 01:38 PM
Hi Folks...

Many thanks for your replies.
I don't know what went wrong, but I did answer Beverleyh yesterday.
My reply obviously hasn't registered.

Here goes again...
My URL is:
http://touringcaravanclub.co.uk/chiltern/chiltern.php
If you take a look at this page (which is under construction and experiment) you will see the slideshow (4) down the right hand side.
The second one down is the one that I have put the links on.
I have also resized the photos being linked to, to 640 x 480 pixels.
When I click on a scrolling photo, it opens up in a new full size browser with the photo in the middle.
What I an looking to do is to click on the link and it open up into a popup browser that is 640 x 480 pixels.

Here is an example of what I am looking for:
http://www.ckmarquees.co.uk/
If you take a look at this page you will see scrolling pictures across the top.
If you click on one of these pictures it will open up in a pop-up browser.

I hope this will make it clearer what I am trying to do.

Once again, thanks very much for your help.

John C

countrydj
04-13-2013, 01:44 PM
Oooops !!!!

AFTER I posted my last reply, I checked the code that jscheuer1 suggested and it worked for me exactly as I want it to.

THANK YOU VERY MUCH...

John C

jscheuer1
04-13-2013, 04:00 PM
Great! However, I didn't realize you had two shows that you wanted to do that to. In some browsers having that added code more than once might cause problems. You should fine tune it by also using the wrapperid in the selector and only putting it after slideshows that you want to do that and that are setup to link the images. So the first one should be removed, that slideshow has no links, the second one should be:


var mygallery2=new fadeSlideShow({
wrapperid: "fadeshow2", //ID of blank DIV on page to house Slideshow
dimensions: [180, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["../photos/regions/chiltern_sm5.jpg", "../photos/regions/chiltern5.jpg", "_new", "This is Davids caravan"],
["../photos/regions/chiltern_sm6.jpg", "../photos/regions/chiltern6.jpg", "_new", "chiltern6.jpg"],
["../photos/regions/chiltern_sm7.jpg", "../photos/regions/chiltern7.jpg", "_new", "chiltern7.jpg"],
["../photos/regions/chiltern_sm8.jpg", "../photos/regions/chiltern8.jpg", "_new", "chiltern8.jpg"],
["../photos/regions/chiltern_sm9.jpg", "../photos/regions/chiltern9.jpg", "_new", "chiltern9.jpg"],
["../photos/regions/chiltern_sm10.jpg", "../photos/regions/chiltern10.jpg", "_new", "chiltern10.jpg"],
["../photos/regions/chiltern_sm11.jpg", "../photos/regions/chiltern11.jpg", "_new", "chiltern11.jpg"] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false, randomize:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 1000, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})
jQuery(function($){
$('#fadeshow2 .gallerylayer a').click(function(e){
window.open(this.href, this.target, 'width=640, height=480');
e.preventDefault();
});
});

The third one should be skipped, again because there are no links in that slideshow. The fourth one should be:


var mygallery4=new fadeSlideShow({
wrapperid: "fadeshow4", //ID of blank DIV on page to house Slideshow
dimensions: [180, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["../photos/regions/chiltern_sm5.jpg", "../photos/regions/chiltern5.jpg", "_new", "This is Davids caravan"],
["../photos/regions/chiltern_sm6.jpg", "../photos/regions/chiltern6.jpg", "_new", "chiltern6.jpg"],
["../photos/regions/chiltern_sm7.jpg", "../photos/regions/chiltern7.jpg", "_new", "chiltern7.jpg"],
["../photos/regions/chiltern_sm8.jpg", "../photos/regions/chiltern8.jpg", "_new", "chiltern8.jpg"],
["../photos/regions/chiltern_sm9.jpg", "../photos/regions/chiltern9.jpg", "_new", "chiltern9.jpg"],
["../photos/regions/chiltern_sm10.jpg", "../photos/regions/chiltern10.jpg", "_new", "chiltern10.jpg"],
["../photos/regions/chiltern_sm11.jpg", "../photos/regions/chiltern11.jpg", "_new", "chiltern11.jpg"] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false, randomize:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 1000, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})
jQuery(function($){
$('#fadeshow4 .gallerylayer a').click(function(e){
window.open(this.href, this.target, 'width=640, height=480');
e.preventDefault();
});
});

Another thing to think about is - what happens if you open one of these and then, before closing it, open another? With "_new", it will reuse the same window, but that window will go behind the window with the slideshow in it. You can try focussing the window, but Opera and Chrome (the most or second most used browser) won't do that. So you could use "_blank", which will not reuse the window, rather making a new window for each larger image. The only problem there is that you can end up with an unlimited number of these windows if the user doesn't close them. You can try closing the previous window before opening a new one, but some browsers might not allow that either. But that might be the best shot:

So, of the two that are now remaining, the first would be:


jQuery(function($){
$('#fadeshow2 .gallerylayer a').click(function(e){
try{$.fn.mynewwin.close();}catch(e){}
$.fn.mynewwin = window.open(this.href, this.target, 'width=640, height=480');
e.preventDefault();
});
});

The second:


jQuery(function($){
$('#fadeshow4 .gallerylayer a').click(function(e){
try{$.fn.mynewwin.close();}catch(e){}
$.fn.mynewwin = window.open(this.href, this.target, 'width=640, height=480');
e.preventDefault();
});
});

I just tested that and it seems to work out quite well.

countrydj
04-13-2013, 05:37 PM
Hi jscheuer1 ...

Thank you so very much for your help and invaluable advice.
As a matter of fact, there are 4 fadeshows on that page.

When I have got all this sorted out, I have to do the same on another 20 regions.

I also have to do something similar on 6 other non regional pages.
I need some help with this.
Please see the bottom of this post.

I have now changed the script that you sent to me, to:

jQuery(function($){
$('#fadeshow1 .gallerylayer a').click(function(e){
window.open(this.href, this.target, 'width=640, height=480');
e.preventDefault();
});
});

jQuery(function($){
$('#fadeshow2 .gallerylayer a').click(function(e){
window.open(this.href, this.target, 'width=640, height=480');
e.preventDefault();
});
});

jQuery(function($){
$('#fadeshow3 .gallerylayer a').click(function(e){
window.open(this.href, this.target, 'width=640, height=480');
e.preventDefault();
});
});

jQuery(function($){
$('#fadeshow4 .gallerylayer a').click(function(e){
window.open(this.href, this.target, 'width=640, height=480');
e.preventDefault();
});
});
As yet, I haven't put the photos and links in the script. I haven't been supplied with them YET...

However, on a different note.
Is this forum for dynamicdrive scripts ONLY, or can I ask another javascript question that is not written by dynamicdrive ???
I actually need some advice on another script, but I don't want to abuse this forum.

Once again, I really am very greatful for your help and advice.

THANK YOU !!!

John C

Beverleyh
04-13-2013, 05:53 PM
Ask any question you like - DD specific or otherwise. There are many talented people here who can help you with lots of web/hardware/general IT queries. Just post your question, and sample pages/scripts where necessary, in the most appropriate forum. For more considerable help requests you can also post in the paid help forum.

jscheuer1
04-13-2013, 06:59 PM
If all of the fadeslideshows on the page either need this or have no links, then we can simplify things.

First, even without this, you don't need a separate script tag for each show. You need one external tag for jQuery, you already have that, and then one external tag for the main script, you have that. Then one internal script tag for all of the initializations plus one bit of added code at the end (which no longer needs the wrapperid selector) if you want to use the new window thing for the slideshows that have links:


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="../files/fadeslideshow.js">

/***********************************************
* Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

</script>
<script type="text/javascript">

var mygallery=new fadeSlideShow({
wrapperid: "fadeshow", //ID of blank DIV on page to house Slideshow
dimensions: [1000, 120], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["../photos/headers/header1.jpg", "", "", ""],
["../photos/headers/header2.jpg", "", "", ""],
["../photos/headers/header3.jpg", "", "", ""],
["../photos/headers/header4.jpg", "", "", ""],
["../photos/headers/header5.jpg", "", "", ""],
["../photos/headers/header6.jpg", "", "", ""],
["../photos/headers/header7.jpg", "", "", ""] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false, randomize:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 1000, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})

var mygallery1=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [180, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["../photos/regions/chiltern1.jpg", "", "", ""],
["../photos/regions/chiltern2.jpg", "", "", ""],
["../photos/regions/chiltern3.jpg", "", "", ""],
["../photos/regions/chiltern4.jpg", "", "", ""],
["../photos/regions/chiltern5.jpg", "", "", ""],
["../photos/regions/chiltern6.jpg", "", "", ""],
["../photos/regions/chiltern7.jpg", "", "", ""] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false, randomize:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 1000, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})

var mygallery2=new fadeSlideShow({
wrapperid: "fadeshow2", //ID of blank DIV on page to house Slideshow
dimensions: [180, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["../photos/regions/chiltern_sm5.jpg", "../photos/regions/chiltern5.jpg", "_new", "This is Davids caravan"],
["../photos/regions/chiltern_sm6.jpg", "../photos/regions/chiltern6.jpg", "_new", "chiltern6.jpg"],
["../photos/regions/chiltern_sm7.jpg", "../photos/regions/chiltern7.jpg", "_new", "chiltern7.jpg"],
["../photos/regions/chiltern_sm8.jpg", "../photos/regions/chiltern8.jpg", "_new", "chiltern8.jpg"],
["../photos/regions/chiltern_sm9.jpg", "../photos/regions/chiltern9.jpg", "_new", "chiltern9.jpg"],
["../photos/regions/chiltern_sm10.jpg", "../photos/regions/chiltern10.jpg", "_new", "chiltern10.jpg"],
["../photos/regions/chiltern_sm11.jpg", "../photos/regions/chiltern11.jpg", "_new", "chiltern11.jpg"] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false, randomize:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 1000, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})

var mygallery3=new fadeSlideShow({
wrapperid: "fadeshow3", //ID of blank DIV on page to house Slideshow
dimensions: [180, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["../photos/headers/header1.jpg", "", "", ""],
["../photos/headers/header2.jpg", "", "", ""],
["../photos/headers/header3.jpg", "", "", ""],
["../photos/headers/header4.jpg", "", "", ""],
["../photos/headers/header5.jpg", "", "", ""],
["../photos/headers/header6.jpg", "", "", ""],
["../photos/headers/header7.jpg", "", "", ""] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false, randomize:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 1000, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})

var mygallery4=new fadeSlideShow({
wrapperid: "fadeshow4", //ID of blank DIV on page to house Slideshow
dimensions: [180, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["../photos/regions/chiltern_sm5.jpg", "../photos/regions/chiltern5.jpg", "_new", "This is Davids caravan"],
["../photos/regions/chiltern_sm6.jpg", "../photos/regions/chiltern6.jpg", "_new", "chiltern6.jpg"],
["../photos/regions/chiltern_sm7.jpg", "../photos/regions/chiltern7.jpg", "_new", "chiltern7.jpg"],
["../photos/regions/chiltern_sm8.jpg", "../photos/regions/chiltern8.jpg", "_new", "chiltern8.jpg"],
["../photos/regions/chiltern_sm9.jpg", "../photos/regions/chiltern9.jpg", "_new", "chiltern9.jpg"],
["../photos/regions/chiltern_sm10.jpg", "../photos/regions/chiltern10.jpg", "_new", "chiltern10.jpg"],
["../photos/regions/chiltern_sm11.jpg", "../photos/regions/chiltern11.jpg", "_new", "chiltern11.jpg"] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false, randomize:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 1000, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})

jQuery(function($){
$('.gallerylayer a').click(function(e){
e.preventDefault();
try{$.fn.mynewwin.close();}catch(e){}
$.fn.mynewwin = window.open(this.href, this.target, 'width=640, height=480');
});
});
</script>

countrydj
04-13-2013, 10:41 PM
Ask any question you like - DD specific or otherwise. There are many talented people here who can help you with lots of web/hardware/general IT queries. Just post your question, and sample pages/scripts where necessary, in the most appropriate forum. For more considerable help requests you can also post in the paid help forum.
Thanks Beverleyh
Beverleyh is online now - You should be in bed at this time...

I have posted my other problem in the javascript section.

Thank you,

John C

Beverleyh
04-13-2013, 10:46 PM
Ha, ha - I have just watched "Get Him To The Greek" and was just checking PMs from iPhone before turning off for the night.

...Now that time has arrived.

Night, night all

countrydj
04-13-2013, 11:13 PM
If all of the fadeslideshows on the page either need this or have no links, then we can simplify things.

First, even without this, you don't need a separate script tag for each show. You need one external tag for jQuery, you already have that, and then one external tag for the main script, you have that. Then one internal script tag for all of the initializations plus one bit of added code at the end (which no longer needs the wrapperid selector) if you want to use the new window thing for the slideshows that have links:


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="../files/fadeslideshow.js">

/***********************************************
* Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

</script>
<script type="text/javascript">

var mygallery=new fadeSlideShow({
wrapperid: "fadeshow", //ID of blank DIV on page to house Slideshow
dimensions: [1000, 120], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["../photos/headers/header1.jpg", "", "", ""],
["../photos/headers/header2.jpg", "", "", ""],
["../photos/headers/header3.jpg", "", "", ""],
["../photos/headers/header4.jpg", "", "", ""],
["../photos/headers/header5.jpg", "", "", ""],
["../photos/headers/header6.jpg", "", "", ""],
["../photos/headers/header7.jpg", "", "", ""] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false, randomize:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 1000, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})

var mygallery1=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [180, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["../photos/regions/chiltern1.jpg", "", "", ""],
["../photos/regions/chiltern2.jpg", "", "", ""],
["../photos/regions/chiltern3.jpg", "", "", ""],
["../photos/regions/chiltern4.jpg", "", "", ""],
["../photos/regions/chiltern5.jpg", "", "", ""],
["../photos/regions/chiltern6.jpg", "", "", ""],
["../photos/regions/chiltern7.jpg", "", "", ""] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false, randomize:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 1000, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})

var mygallery2=new fadeSlideShow({
wrapperid: "fadeshow2", //ID of blank DIV on page to house Slideshow
dimensions: [180, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["../photos/regions/chiltern_sm5.jpg", "../photos/regions/chiltern5.jpg", "_new", "This is Davids caravan"],
["../photos/regions/chiltern_sm6.jpg", "../photos/regions/chiltern6.jpg", "_new", "chiltern6.jpg"],
["../photos/regions/chiltern_sm7.jpg", "../photos/regions/chiltern7.jpg", "_new", "chiltern7.jpg"],
["../photos/regions/chiltern_sm8.jpg", "../photos/regions/chiltern8.jpg", "_new", "chiltern8.jpg"],
["../photos/regions/chiltern_sm9.jpg", "../photos/regions/chiltern9.jpg", "_new", "chiltern9.jpg"],
["../photos/regions/chiltern_sm10.jpg", "../photos/regions/chiltern10.jpg", "_new", "chiltern10.jpg"],
["../photos/regions/chiltern_sm11.jpg", "../photos/regions/chiltern11.jpg", "_new", "chiltern11.jpg"] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false, randomize:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 1000, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})

var mygallery3=new fadeSlideShow({
wrapperid: "fadeshow3", //ID of blank DIV on page to house Slideshow
dimensions: [180, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["../photos/headers/header1.jpg", "", "", ""],
["../photos/headers/header2.jpg", "", "", ""],
["../photos/headers/header3.jpg", "", "", ""],
["../photos/headers/header4.jpg", "", "", ""],
["../photos/headers/header5.jpg", "", "", ""],
["../photos/headers/header6.jpg", "", "", ""],
["../photos/headers/header7.jpg", "", "", ""] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false, randomize:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 1000, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})

var mygallery4=new fadeSlideShow({
wrapperid: "fadeshow4", //ID of blank DIV on page to house Slideshow
dimensions: [180, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["../photos/regions/chiltern_sm5.jpg", "../photos/regions/chiltern5.jpg", "_new", "This is Davids caravan"],
["../photos/regions/chiltern_sm6.jpg", "../photos/regions/chiltern6.jpg", "_new", "chiltern6.jpg"],
["../photos/regions/chiltern_sm7.jpg", "../photos/regions/chiltern7.jpg", "_new", "chiltern7.jpg"],
["../photos/regions/chiltern_sm8.jpg", "../photos/regions/chiltern8.jpg", "_new", "chiltern8.jpg"],
["../photos/regions/chiltern_sm9.jpg", "../photos/regions/chiltern9.jpg", "_new", "chiltern9.jpg"],
["../photos/regions/chiltern_sm10.jpg", "../photos/regions/chiltern10.jpg", "_new", "chiltern10.jpg"],
["../photos/regions/chiltern_sm11.jpg", "../photos/regions/chiltern11.jpg", "_new", "chiltern11.jpg"] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false, randomize:true},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 1000, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: ""
})

jQuery(function($){ //author's note: this function is wrong, now corrected in the original and in a later post - jscheuer1
$(.gallerylayer a').click(function(e){
try{$.fn.mynewwin.close();}catch(e){}
$.fn.mynewwin = window.open(this.href, this.target, 'width=640, height=480');
e.preventDefault();
});
});
</script>
Hi jscheuer1...
Thanks very much for your simplified and more efficient script.
However, the highlighted code above KILLS ALL the slideshows.
The script works fine without the highlighted script, but not with it.

Regards,

John C

PS, How can I include a signature to my posts ?

jscheuer1
04-14-2013, 01:23 AM
Cut and paste typo on my part, sorry. That highlighted section is missing an opening quote mark. It should be:


jQuery(function($){
$('.gallerylayer a').click(function(e){
e.preventDefault();
try{$.fn.mynewwin.close();}catch(e){}
$.fn.mynewwin = window.open(this.href, this.target, 'width=640, height=480');
});
});

Oh, and I just noticed testing this somewhere else that the e.preventDefault() needs to be moved up as I've just done to prevent the image from also opening in the main page in at least some IE browsers.

Oh and about the signature, you have to have been a member for at least 30 days and have at least 100 posts to qualify. Once you do, you can configure a signature by editing your profile. See:

http://www.dynamicdrive.com/forums/showthread.php?34180-New-usergroups-and-rankings-on-DD-forums-explained-(July-8th-08-)

for more info.

countrydj
04-14-2013, 11:40 AM
Hi jscheuer1's ...

Thank you very much for the modified script.
It worked just fine.

Thanks also for the info about Signatures.
I must say that I am very surprised about this. It is the first time I have seen such a restriction.
I don't mind though. It would just have saved me from signing every post (I'm an idle SOB)

Best regards,

John C

jscheuer1
04-14-2013, 02:43 PM
I've been playing around with the popup window code some more, this looks even better:


jQuery(function($){
$.fn.mynewwin = {close: null};
$('.gallerylayer a').click(function(e){
if($.fn.mynewwin.close){$.fn.mynewwin.close();}
$.fn.mynewwin = window.open(this.href, this.target, 'width=640, height=480');
e.preventDefault();
});
$(window).unload(function(){
if($.fn.mynewwin.close){$.fn.mynewwin.close();}
});
});

There is no longer a problem in IE with the preventDefault in its proper place, and with this version if the user leaves the page with one of these new windows open, it will close.

countrydj
04-14-2013, 11:19 PM
Hi jscheuer1 ...

I can't believe that you have gone to so much trouble for my benefit.
It does work better than the previous script.

I'm sure that it will benefit the script for future userd.

I really am VERY GRATEFUL..

THANK YOU

John C