Solved

Call Slimbox through URL

Posted on 2009-04-02
8
337 Views
Last Modified: 2013-11-11
Go this URL and click an image:
http://c.osbornewood.com/cadcd/all__34-and-one-half-inches.cfm

It pulls up an image using Slimbox.

I would like to set it up so I can link to the page Slimbox will pull up a particular image when it loads.

The url would take this form:

http://c.osbornewood.com/cadcd/all__34-and-one-half-inches.cfm#part_1456
http://c.osbornewood.com/cadcd/all__34-and-one-half-inches.cfm?part=1456#part_1456

FYI, this will go on a DVD.  I can change the output as much as I like, but the final version has to be static.  JavaScript needs to do the heavy work here.
0
Comment
Question by:M256
  • 5
  • 3
8 Comments
 
LVL 10

Expert Comment

by:MaxOvrdrv2
ID: 24065741
you mean you want to link from YOUR page to THIS page and just have Slimbox load with the image within YOUR page? i'm not sure what you're trying to accomplish.
0
 
LVL 5

Author Comment

by:M256
ID: 24066600
Sorry.

[Index] page with a list of links.

[Image] page, with slimbox and tons if images.

Each link from [index] page will open the [image] page to #part_XXXX and in that same action on the [image] page will also open the appropriate image in slimbox.
0
 
LVL 10

Expert Comment

by:MaxOvrdrv2
ID: 24067823
I still don't understand... Seems to me like you just want to create all the links yourself. What do you need javascript for?

0
 
LVL 5

Author Comment

by:M256
ID: 24067858
The links pull up the page, and move it to the correct line.  The JavaScript is to activate Slimbox, opening the correct image while darkening the rest of the page.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 10

Expert Comment

by:MaxOvrdrv2
ID: 24067881
Easy,

Put a query string in the link, then on the page itself, put a javascript function that checks the querystrin, and if present, duplicates the javascript contained in the link on the page.
0
 
LVL 5

Author Comment

by:M256
ID: 24082548
Sounds good in theory :)

I looked at the code and while I know a little JavaScript I couldn't see how to do it right away.

Can you check it out?  I've raised the points on the question...
0
 
LVL 10

Accepted Solution

by:
MaxOvrdrv2 earned 300 total points
ID: 24083043
links on your first page have the following:

imagespage.cfm?id=1496_2d

imagespage has the following, at the very end (note that this will not work unless you have the slimbox code working on your own server, if you're trying to rip-off someone else's functionality that they probably paid for, i can't help you). The code below actually brings you to the .dxf file instead of the slimbox, but you can use this and put in the right code to call in slimbox since this is your product, right?! this is just to give you the idea on how to do it yourself :
<script type="text/javascript">

//here we get the query strings passed to the url, you can add more and split them (&) for other uses

var urlid= window.location.search.substring(1).replace("id=","");

//here we check if a querystring is present, if so

if(urlid!="")

{

   //open a new window with the .dxf file that corresponds to the query string.

   window.open("../../files/2dDXF/" + urlid + ".dxf";

}

</script>

Open in new window

0
 
LVL 10

Expert Comment

by:MaxOvrdrv2
ID: 24083045
sorry... made a mistake, forgot to close the paretheses on the window.open:
window.open("../../files/2dDXF/" + urlid + ".dxf");

Open in new window

0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now