Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / last issue! help so i can get this F*&$K@ site up by midnight!! :)

last issue! help so i can get this F*&$K@ site up by midnight!! :)

Locked

Started by customk1 on 15 May 2009, 3:16 AM · Views: 1,097

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
15 May 2009, 3:16 AM
#1
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Post #1 by customk1

ok, final "major" issue before i go live, hopefully within the hour if i can get some help!

site: http://customk9design.com/catalogzen

issue: javascript running on front page only, will only display in the default proportions, unable to re-size.

have script from here: http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

added this to "define pages editor: main_page":

<script type="text/javascript">
//new fadeshow(IMAGES_ARRAY_NAME, slideshow_width, slideshow_height, borderwidth, delay, pause (0=no, 1=yes), optionalRandomOrder)
new fadeshow(fadeimages, 140, 225, 0, 3000, 1, "R")
new fadeshow(fadeimages2, 140, 225, 0, 3000, 0)
 
</script>

edited this file to call the photos: (pertinent changes in RED)

/***********************************************
* Ultimate Fade-In Slideshow (v1.51): © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
 
var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
//fadeimages[0]=["photo1.jpg", "", ""] //plain image syntax
//fadeimages[1]=["photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax
//fadeimages[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax
fadeimages[0]=["/catalogzen/images/slideshowimages/dblh2_01_LRG.jpg", "index.php?main_page=product_info&cPath=5_17&products_id=47", ""]
fadeimages[1]=["/catalogzen/images/slideshowimages/pbll1_LRG.jpg", "index.php?main_page=product_info&cPath=3_22&products_id=39", ""]
fadeimages[2]=["/catalogzen/images/slideshowimages/pbln4_01_LRG.jpg", "index.php?main_page=product_info&cPath=3_22&products_id=42", ""]
fadeimages[3]=["/catalogzen/images/slideshowimages/dblc2_02_LRG.jpg", "index.php?main_page=product_info&cPath=1_14&products_id=10", ""]
fadeimages[4]=["/catalogzen/images/slideshowimages/pblm3_02_LRG.jpg", "index.php?main_page=product_info&cPath=4_18&products_id=22", ""]
fadeimages[5]=["/catalogzen/images/slideshowimages/pblc1_02_LRG.jpg", "index.php?main_page=product_info&cPath=1_11&products_id=5", ""]
 
var fadeimages2=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
//fadeimages2[0]=["photo1.jpg", "", ""] //plain image syntax
//fadeimages2[1]=["photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax
//fadeimages2[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax
 
var fadebgcolor="white"

////NO need to edit beyond here/////////////
 
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
else if (crossobj.style.opacity&&!crossobj.filters)
crossobj.style.opacity=this.degree/101
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}

all my images are 500x500, however any time i modify the above script (1st- smaller one) to anything other than the provided 140x255 nothing displays.

HELP ME FINISH!!! :)

"Be the Change you wish to see in the World..." -Gandhi

15 May 2009, 3:32 AM
#2
mrchristoh avatar

mrchristoh

New Zenner

Join Date:
May 2009
Location:
from parts unknown
Posts:
74
Plugin Contributions:
0

Post #2 by mrchristoh

Hi,

I am not sure if this helps?.....

I ran firebug to look at the css etc.

your div is as such:

<div id="canvas1_0" style="position: absolute; width: 140px; height: 225px; top: 0pt; left: 0pt; opacity: 0.1; background-color: white;"/> <div id="canvas1_1" style="position: absolute; width: 140px; height: 225px; top: 0pt; left: 0pt; opacity: 0.1; background-color: white;"/>

your css is:
element.style {
background-color:white;
height:225px;
left:0;
opacity:0.1;
position:absolute;
top:0;
width:140px;
}

have your tried not using the 'embedded style' in your div?
or
not give the with in your css?

Also did you check your
<script type="text/javascript">
//new fadeshow(IMAGES_ARRAY_NAME, slideshow_width, slideshow_height, borderwidth, delay, pause (0=no, 1=yes), optionalRandomOrder)
new fadeshow(fadeimages, 140, 225, 0, 3000, 1, "R")
new fadeshow(fadeimages2, 140, 225, 0, 3000, 0)

</script>

should be.....
<script type="text/javascript">
//new fadeshow(IMAGES_ARRAY_NAME, slideshow_width, slideshow_height, borderwidth, delay, pause (0=no, 1=yes), optionalRandomOrder)
new fadeshow(fadeimages, 500, 500, 0, 3000, 1, "R")
new fadeshow(fadeimages2, 500, 500, 0, 3000, 0)

</script>

hope this helps?

15 May 2009, 3:39 AM
#3
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Post #3 by customk1

MrC... thanks for your reply! :)

1st, i know to change the javascript on the define page editor to 500x500... i put it back to where it would "work" so that anyone looking at it could better see the issue...

as for the css coding... (bear with me, im getting a bit punchy!)
where is that "element style"? i dont recall adding anything to my css when i first added this slide show...

will look a little deeper into that...

in the meantime, what do you mean by "have your tried not using the 'embedded style' in your div?"

"Be the Change you wish to see in the World..." -Gandhi

15 May 2009, 3:45 AM
#4
mrchristoh avatar

mrchristoh

New Zenner

Join Date:
May 2009
Location:
from parts unknown
Posts:
74
Plugin Contributions:
0

Post #4 by mrchristoh

hi,

do you use firefox browser?

if so there is a nice tool called 'firebug' that lets you inspect the code and css in real-time whilst browsing.

this is what i see when i use firebug to inspect your elements:

<div id="canvas1_0" style="position: absolute; width: 140px; height: 225px; top: 0pt; left: 0pt; opacity: 0.1; background-color: white;"/> <div id="canvas1_1" style="position: absolute; width: 140px; height: 225px; top: 0pt; left: 0pt; opacity: 0.1; background-color: white;"/>

*Ps: when using firebug you can do some 'ad-hoc' editting to change your layout etc......until you refresh your browser, then it reverts to your original base code.

cheers

15 May 2009, 3:50 AM
#5
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Post #5 by customk1

yeah, i use firefox... and have firebug, but admitedly dont know the program well enough to get what i really need out of it...

those div id's are being created by the script i put in the define main page... those same ones if i change to 500x500 dont work...

i can change them now (give me a sec) and if you go back to firebug you should see them change, but the slideshow wont work..

any info about that "element style"? where is that??

"Be the Change you wish to see in the World..." -Gandhi

15 May 2009, 3:51 AM
#6
mrchristoh avatar

mrchristoh

New Zenner

Join Date:
May 2009
Location:
from parts unknown
Posts:
74
Plugin Contributions:
0

Post #6 by mrchristoh

hi,

i done the ad-hoc edit with firebug --------- its works and shows the slideshow

i have corrected the issue and i can see your images in full 500x500:

<div id="master0" style="overflow: hidden; position: relative; width: 500px; height: 500px;">

<div id="canvas0_0" style="position: absolute; width: 500px; height: 500px; top: 0pt; left: 0pt; opacity: 0.990099; background-color: white; z-index: 41;"> <a target="" href="index.php?main_page=product_info&cPath=4_18&products_id=22"> </a> </div> <div id="canvas0_1" style="position: absolute; width: 500px; height: 500px; top: 0pt; left: 0pt; opacity: 0.990099; background-color: white; z-index: 41;"> </div> </div> <div id="master1" style="overflow: hidden; position: relative; width: 500px; height: 500px;"> <div id="canvas1_0" style="position: absolute; width: 500px; height: 500px; top: 0pt; left: 0pt; opacity: 0.1; background-color: white;"/> <div id="canvas1_1" style="position: absolute; width: 500px; height: 500px; top: 0pt; left: 0pt; opacity: 0.1; background-color: white;"/> </div> </div>

please try this tool.........it helps so so so much

if you need i can try to help more?

thanks

15 May 2009, 3:57 AM
#7
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Post #7 by customk1

great! but where do i put that data?

it doesnt look anything like:

<script type="text/javascript">
//new fadeshow(IMAGES_ARRAY_NAME, slideshow_width, slideshow_height, borderwidth, delay, pause (0=no, 1=yes), optionalRandomOrder)
new fadeshow(fadeimages, 140, 225, 0, 3000, 1, "R")
new fadeshow(fadeimages2, 140, 225, 0, 3000, 0)
 
</script>

"Be the Change you wish to see in the World..." -Gandhi

15 May 2009, 4:01 AM
#8
mrchristoh avatar

mrchristoh

New Zenner

Join Date:
May 2009
Location:
from parts unknown
Posts:
74
Plugin Contributions:
0

Post #8 by mrchristoh

did you change

<script type="text/javascript">
//new fadeshow(IMAGES_ARRAY_NAME, slideshow_width, slideshow_height, borderwidth, delay, pause (0=no, 1=yes), optionalRandomOrder)
new fadeshow(fadeimages, 140, 225, 0, 3000, 1, "R")
new fadeshow(fadeimages2, 140, 225, 0, 3000, 0)
</script>

to this:

<script type="text/javascript">
//new fadeshow(IMAGES_ARRAY_NAME, slideshow_width, slideshow_height, borderwidth, delay, pause (0=no, 1=yes), optionalRandomOrder)
new fadeshow(fadeimages, 500, 500, 0, 3000, 1, "R")
new fadeshow(fadeimages2, 500, 500, 0, 3000, 0)
</script>

I have a funny feeling that this is the issue?

the edits i made are in the code generated by this script which leads me to believe that you need to change the code as above.

15 May 2009, 4:10 AM
#9
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Post #9 by customk1

1st off... weird.. because that was the same change i made before, with no luck.

NOW it shows, which is great.. however, i dont want both slideshows to show... and when i delete the second one... nothing works...

i will try to disable with a // ? and wait for further input from you.

ps. ur my hero... :)

"Be the Change you wish to see in the World..." -Gandhi

15 May 2009, 4:14 AM
#10
mrchristoh avatar

mrchristoh

New Zenner

Join Date:
May 2009
Location:
from parts unknown
Posts:
74
Plugin Contributions:
0

Post #10 by mrchristoh

im glad it worked :)

sometimes after you have made the changes......your hosting company sometime needs some time to reflect these changes due to caching etc.

15 May 2009, 4:18 AM
#11
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Post #11 by customk1

well, no luck on disabling the 2nd show below..

any thoughts? i have tried deleting that row, putting // before it, and changing to 1, 1 instead of 500, 500....

no luck, any changes made seem to disable the whole show?

"Be the Change you wish to see in the World..." -Gandhi

15 May 2009, 4:49 AM
#12
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Post #12 by customk1

ok, figured it out... apparently, something happens when i go back into define page editor AFTER already putting the code in... something about teh wysiwyg is messing it up... so if i made one change, saved, reloaded page... went back to editor and made another change, it would break.

made all the changes at once, saved... and its golden! thanks for your help...

"Be the Change you wish to see in the World..." -Gandhi