PDA

View Full Version : Help me please



phaZe
06-09-2005, 01:03 PM
I'm having problems adding link coding to the convey belt slideshow script. I want the links to open up in a new centred window at a a size of 400 x 300 with no scroll bar. Can anyone tell me what code I need to add?

jscheuer1
06-09-2005, 08:33 PM
You can use something like this:


leftrightslide[0]='<a href="#" onclick="window.open(\'http://www.yahoo.com\',\'yahWin\',\'width=400, height=300\');return false"><img src="dynamicbook1.gif" border=1></a>'

phaZe
06-10-2005, 10:29 AM
Excellent, but what snippet of code do I need to add so that the window opens centraly and not left of screen ?

jscheuer1
06-10-2005, 04:16 PM
That's a little more involved. Use the Popup Window Generator (http://www.dynamicdrive.com/dynamicindex8/popwin.htm). Then after you put the generated script in the head, you can use something like this in the Conveyor script:
leftrightslide[0]='<a href="http://www.google.com" onclick="NewWindow(this.href,\'mywin\',\'500\',\'300\',\'no\',\'center\');return false" onfocus="this.blur()">><img src="dynamicbook1.gif" border=1></a>'The real trick is that whatever code is generated by the Popup Generator for use in the html part of the page must be escaped, substituting:

\'

for:

'

wherever it occurs before it is used in the Conveyor script. The neat thing is, if you want a bunch of these Popup Windows, all of the same dimensions and location on the screen but with different links, once you've generated the code for one, you can just use the one script for all (head part of the script) simply changing the link's href in the 'html' part of the script.

phaZe
06-11-2005, 07:21 PM
cheers

thank you John

frodewells
06-13-2005, 06:44 AM
What snippet of code do I need to add so that it will display content in an iframe when I move the mouse over an image in the Conveyor belt?

jscheuer1
06-13-2005, 06:23 PM
First you need a named iframe on your page ex:
<iframe name="fred" src="" width="200" height="200" scrolling="no" frameborder="0"></iframe>Set its width and height to that of the content you wish to display in it OR set its scrolling to "yes".

Then in the conveyor script do something like this (from the demo, addition in red):
leftrightslide[0]='<a href="http://"><img onmouseover="fred.location.replace(\'some.htm\')" src="dynamicbook1.gif" border=1></a>'You can substitute any html file for some.htm. You can also use an image file.

frodewells
06-17-2005, 10:55 AM
If I replace the some.htm with an image file example image.jpg
the image will not show up in the iframe - a box comes up asking me to
open or save the image - how can I adjust the code to work around this?

Frode

First you need a named iframe on your page ex:
Code:
<iframe name="fred" src="" width="200" height="200" scrolling="no" frameborder="0"></iframe>Set its width and height to that of the content you wish to display in it OR set its scrolling to "yes".

Then in the conveyor script do something like this (from the demo, addition in red):
Code:
leftrightslide[0]='<a href="http://"><img onmouseover="fred.location.replace(\'some.htm\')" src="dynamicbook1.gif" border=1></a>'You can substitute any html file for some.htm. You can also use an image file.

jscheuer1
06-17-2005, 06:49 PM
I just tested this here under Windows XP using both IE6 and FF1.0.4 and both worked fine with an image file. What browser/OS combination are you using? It may be a setting in your browser. Anyways, you can get around it by making a page and putting your image on it. Then use the page's url instead of that of the image.

One other thought, if you have made a syntax error, this could be the cause. If that's it, to diagnose that, I'd have to see a demo of the problem.

GmH
09-21-2005, 06:21 AM
Hej John,
I got stuck on the same problems with Conveyor Scripts as PhaZe above, but your patient and absolutely clear instructions are more than helpful.

Some people can learn a little about scripts, staggering through various stages of web-design, but you seem to have the grasped scripts better than most - and you are prepared to share your time and yours skills more than most :) .

Thanks (from those of us that still struggle with scripts), and thanks for your human efforts.

Graeme.

GmH
09-21-2005, 07:31 AM
Hej again John,
just couldn't resist trying out your solutions to image sizing for PopUp windows linked to Conveyor Belt scripts.

Another question about the same script ... whereas one can easily switch the border on/off to the dynamicbook images - how does one change the colour of the frame? If not the pixel width?

GmH

jscheuer1
09-21-2005, 08:10 AM
whereas one can easily switch the border on/off to the dynamicbook images - how does one change the colour of the frame? If not the pixel width?I'm not really clear on just what element you want to apply what effect(s) to. Could you be a bit more specific? Do you want to apply a border of a specified width and color to the images? To the slideshow itself? Or to something else? Or, is the effect you are looking for something other than a border?

GmH
09-23-2005, 01:42 PM
John,
Controlling the border for the iframe is not the problem.

The query relates to our ever famous Conveyor Belt Slide Show (above): the snippet in question =

leftrightslide[0]='<a href="http://"><img src="dynamicbook_1.gif" border=0></a>'

Obviously 0/1 switches the border on/off, but the default border colour appears blue whenever I've used it. If the blue-colour doesn't suit the design, I've got to opt for switching it off - or is there another way to set a border colour? Or change the border thickness?

Thanks again for your attention.
GmH

jscheuer1
09-23-2005, 04:37 PM
OK, now I know what the question is, yes, there is a fairly simple way, css. Set the border to zero in the snippet and all entries like it in the script. Then put this style block in the head of the page:

<style type="text/css">
#test2 img, #test3 img {
border: 5px solid yellow;
}
</style>The red part can be adjusted using any valid values for the property 'border' see Blooberry CSS (http://www.blooberry.com/indexdot/css/properties/border/border.htm) or your favorite css resource for details. To get your top and bottom borders (if they make the images higher than the script's height) to appear in the slideshow increase the:

var sliderheight="225px"

variable accordingly.