Welcome to Dream.In.Code
Getting Help is Easy!

Join 86,399 Programmers. There are 1,451 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

JavaScript Slideshows

 
Reply to this topicStart new topic

JavaScript Slideshows

rodstol
post 22 Apr, 2008 - 01:45 PM
Post #1


New D.I.C Head

*
Joined: 3 Apr, 2008
Posts: 17



I've been looking at this slideshow code for a couple days now trying to decide how best to go about making it access two separate slideshows.
As it sits, it accesses one slideshow with multiple galleries. But say you wanted two different slideshows, with the galleries separating into one for functions and another separating into manufacturers of a line of products, set up on different links.


I was looking at the 5th line of code..that is the link to the slideshow...is there away to change that "var" to a specified link? So that you can put into two separate links?

Assuming you don't have to make any huge changes to the software, I assume you can simply change the links that are accessed?

CODE


var windowW=640 // wide
var windowH=640 // high

var windowX = 250 // from left
var windowY = 100 // from top

var urlPop = "Slideshow/Gallery001.html"


var title =  "Mr. X | Business Machines"


var autoclose = true

s = "width="+windowW+",height="+windowH;
var beIE = document.all?true:false

function openFrameless(){
  if (beIE){
    NFW = window.open("","popFrameless","fullscreen,"+s)    
    NFW.blur()
    window.focus()      
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
    var frameString=""+
"<html>"+
"<head>"+
"<title>"+title+"</title>"+
"</head>"+
"<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+
"<frame name='top' src='"+urlPop+"' scrolling=auto>"+
"<frame name='bottom' src='about:blank' scrolling='no'>"+
"</frameset>"+
"</html>"
    NFW.document.open();
    NFW.document.write(frameString)
    NFW.document.close()
  } else {
    NFW=window.open(urlPop,"popFrameless","scrollbars,"+s)
    NFW.blur()
    window.focus()
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
  }  
  NFW.focus()  
  if (autoclose){
    window.onunload = function(){NFW.close()}
  }
}



This is linked to a .js file. I know this isn't the most efficient way of doing it, but could you simply create another.js file with a different name and link the second show to the new file?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


rodstol
post 25 Apr, 2008 - 11:41 AM
Post #2


New D.I.C Head

*
Joined: 3 Apr, 2008
Posts: 17

Did I not provide enough information?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

PsychoCoder
post 25 Apr, 2008 - 11:48 AM
Post #3


ToCode || !ToCode

Group Icon
Joined: 26 Jul, 2007
Posts: 5,858

The way I would do it is put into a function that accepts both a title and url as a parameter


jscript

function SlideShow(url, title)
{
var windowW=640; // wide
var windowH=640; // high

var windowX = 250 ;// from left
var windowY = 100 ;// from top

var urlPop = url;


var title = title;


var autoclose = true;
}
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

rodstol
post 25 Apr, 2008 - 12:24 PM
Post #4


New D.I.C Head

*
Joined: 3 Apr, 2008
Posts: 17

Hmm, maybe I should have put "beginner"....

I'm not seeing how to put this into 2 separate links.
I understand the logic behind it, but what it needs to be essentially doing is one link pulling up galleryone.html page, while the other link is pulling up a gallerytwo.html.

Now, I'm assuming you can add variables...
CODE

function SlideShow(urlone, urltwo, title)
{
      var windowW=640; // wide
      var windowH=640; // high

       var windowX = 250;// from left
       var windowY = 100;// from top

        var urlonePop = galleryone;
        var urltwoPop = gallerytwo;

       var title =  title;


       var autoclose = true;
}


So the menu code would look like...
CODE

var menu4=new Array()
menu4[0]='<a href="java script:openFrameless(urlonePop)" class="drop_link">By Manufacturer</a>'
menu4[1]='<a href="java script:openFrameless(urltwoPop)" class="drop_link">By Function</a>'


Am I understanding that correctly?

Or would the whole thing be easier to put it all in an iframe and ditch the frameless popup?

This post has been edited by rodstol: 25 Apr, 2008 - 01:07 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/17/08 06:09AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month