473,847 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Conflict Script Problem

133 New Member

I need to use these 2 scripts together but for some reason when i try the first one does not work.

Script 1 is a IE PnG Fix and Script 2 is a image slideshow.

Expand|Select|Wrap|Line Numbers
  1. var arVersion = navigator.appVersion.split("MSIE")
  2. var version = parseFloat(arVersion[1])
  4. if ((version >= 5.5) && (document.body.filters)) 
  5. {
  6.    for(var i=0; i<document.images.length; i++)
  7.    {
  8.       var img = document.images[i]
  9.       var imgName = img.src.toUpperCase()
  10.       if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
  11.       {
  12.          var imgID = (img.id) ? "id='" + img.id + "' " : ""
  13.          var imgClass = (img.className) ? "class='" + img.className + "' " : ""
  14.          var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
  15.          var imgStyle = "display:inline-block;" + img.style.cssText 
  16.          if (img.align == "left") imgStyle = "float:left;" + imgStyle
  17.          if (img.align == "right") imgStyle = "float:right;" + imgStyle
  18.          if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
  19.          var strNewHTML = "<span " + imgID + imgClass + imgTitle
  20.          + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
  21.          + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
  22.          + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
  23.          img.outerHTML = strNewHTML
  24.          i = i-1
  25.       }
  26.    }
  27. }
Feb 25 '08 #1
2 1523
1,654 Recognized Expert Top Contributor
Please post your question in parts as its too to be displayed here.
Feb 25 '08 #2
133 New Member
Expand|Select|Wrap|Line Numbers
  3. var fadeimages=new Array()
  4. //SET IMAGE PATHS. Extend or contract array as needed
  5. fadeimages[0]=["images/entertainment-group.jpg", "", ""] //plain image syntax
  6. fadeimages[1]=["images/rock-concert.jpg", "", ""] //image with link syntax
  7. fadeimages[2]=["images/ballet.jpg", "", ""] //image with link and target syntax
  8. fadeimages[3]=["images/corporate-event.jpg", "", ""] //image with link and target syntax
  9. fadeimages[4]=["images/wedding-chair.jpg", "", ""] //image with link and target syntax
  10. fadeimages[5]=["images/dj-decks.jpg", "", ""] //image with link and target syntax
  12. var fadeimages2=new Array() //2nd array set example. Remove or add more sets as needed.
  13. //SET IMAGE PATHS. Extend or contract array as needed
  15. var fadebgcolor="white"
  17. ////NO need to edit beyond here/////////////
  19. var fadearray=new Array() //array to cache fadeshow instances
  20. var fadeclear=new Array() //array to cache corresponding clearinterval pointers
  22. var dom=(document.getElementById) //modern dom browsers
  23. var iebrowser=document.all
  25. function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
  26. this.pausecheck=pause
  27. this.mouseovercheck=0
  28. this.delay=delay
  29. this.degree=10 //initial opacity degree (10%)
  30. this.curimageindex=0
  31. this.nextimageindex=1
  32. fadearray[fadearray.length]=this
  33. this.slideshowid=fadearray.length-1
  34. this.canvasbase="canvas"+this.slideshowid
  35. this.curcanvas=this.canvasbase+"_0"
  36. if (typeof displayorder!="undefined")
  37. theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
  38. this.theimages=theimages
  39. this.imageborder=parseInt(borderwidth)
  40. this.postimages=new Array() //preload images
  41. for (p=0;p<theimages.length;p++){
  42. this.postimages[p]=new Image()
  43. this.postimages[p].src=theimages[p][0]
  44. }
  46. var fadewidth=fadewidth+this.imageborder*2
  47. var fadeheight=fadeheight+this.imageborder*2
  49. if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
  50. 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);-moz-opacity:10;-khtml-opacity:10;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);-moz-opacity:10;background-color:'+fadebgcolor+'"></div></div>')
  51. else
  52. document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
  54. if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
  55. this.startit()
  56. else{
  57. this.curimageindex++
  58. setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
  59. }
  60. }
  62. function fadepic(obj){
  63. if (obj.degree<100){
  64. obj.degree+=10
  65. if (obj.tempobj.filters&&obj.tempobj.filters[0]){
  66. if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
  67. obj.tempobj.filters[0].opacity=obj.degree
  68. else //else if IE5.5-
  69. obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
  70. }
  71. else if (obj.tempobj.style.MozOpacity)
  72. obj.tempobj.style.MozOpacity=obj.degree/101
  73. else if (obj.tempobj.style.KhtmlOpacity)
  74. obj.tempobj.style.KhtmlOpacity=obj.degree/100
  75. }
  76. else{
  77. clearInterval(fadeclear[obj.slideshowid])
  78. obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
  79. obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
  80. obj.populateslide(obj.tempobj, obj.nextimageindex)
  81. obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
  82. setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
  83. }
  84. }
  86. fadeshow.prototype.populateslide=function(picobj, picindex){
  87. var slideHTML=""
  88. if (this.theimages[picindex][1]!="") //if associated link exists for image
  89. slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
  90. slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
  91. if (this.theimages[picindex][1]!="") //if associated link exists for image
  92. slideHTML+='</a>'
  93. picobj.innerHTML=slideHTML
  94. }
  97. fadeshow.prototype.rotateimage=function(){
  98. if (this.pausecheck==1) //if pause onMouseover enabled, cache object
  99. var cacheobj=this
  100. if (this.mouseovercheck==1)
  101. setTimeout(function(){cacheobj.rotateimage()}, 100)
  102. else if (iebrowser&&dom||dom){
  103. this.resetit()
  104. var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
  105. crossobj.style.zIndex++
  106. fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
  107. this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
  108. }
  109. else{
  110. var ns4imgobj=document.images['defaultslide'+this.slideshowid]
  111. ns4imgobj.src=this.postimages[this.curimageindex].src
  112. }
  113. this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
  114. }
  116. fadeshow.prototype.resetit=function(){
  117. this.degree=10
  118. var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
  119. if (crossobj.filters&&crossobj.filters[0]){
  120. if (typeof crossobj.filters[0].opacity=="number") //if IE6+
  121. crossobj.filters(0).opacity=this.degree
  122. else //else if IE5.5-
  123. crossobj.style.filter="alpha(opacity="+this.degree+")"
  124. }
  125. else if (crossobj.style.MozOpacity)
  126. crossobj.style.MozOpacity=this.degree/101
  127. else if (crossobj.style.KhtmlOpacity)
  128. crossobj.style.KhtmlOpacity=obj.degree/100
  129. }
  132. fadeshow.prototype.startit=function(){
  133. var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
  134. this.populateslide(crossobj, this.curimageindex)
  135. if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
  136. var cacheobj=this
  137. var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
  138. crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
  139. crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
  140. }
  141. this.rotateimage()
  142. }
Feb 25 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

by: sentinel | last post by:
Hi, Wonder if anyone can help with this problem: I am using an app with several pages, using a session to track vars between the pages, and using an image map to re-direct back and forwards between the pages. The way I redirect is when the image map is clicked on, it posts to a page called 'control.php' which passes the POST vars to the
by: StaZ | last post by:
Hello I have a ASP script that generates a jpg/gif image using the Overpower.ImageLib component. I do all my tests on my own intranet server before uploading it to the webhost Actually i try to use the font "CasacedScript" to generates page titles.
by: P Wolpert | last post by:
This is my first post. I hope I don't sound stupid. I have a script conflict when I put two scripts on one page. Both scripts will work if I use one at a time but the menu button script will not work when I add the scrolling text script. One script, the menu button script, has an "Onload" command and the other one does not. From what I know, and that's not much, I need to put both scripts in the "Onload" command. I just don't know how to...
by: email | last post by:
I'm trying to combine these two scripts to acomplish a combined effect. None of my variables are duplicates so that's not the problem. I've been able to identify the line that breaks the first script - however I don't know how to fix it. Both scripts work great separately. When I comment out the 1 line in the 2nd script the 1st script works. And when I leave the comment out the second one works but not the first. Please HELP! // 1st...
by: loquini | last post by:
Hi, I'm using this piece of code, both scripts work fine separately but together only works the second one, How can I solve this conflict??? plss help me <body> <div id="watermarklogo" style="position:absolute;"></div> <script src="staticlogo.js"> </script>
by: Caesar Augustus | last post by:
I'm having a problem with two different javascript controls in my app. The first chuck of javascript that I pasted into my app is the client-side calendar control popup which works fine when first used. The second piece of javascript pasted into the app serves as a data validation message box that fires after some server-side code executes (if a certain error condition exists). This action is tied to a submit button that upon NO error...
by: kae | last post by:
Hi there, this may not be an advanced problem but to me it is i got a great looking slide show script from this site (http://www.dhteumeuleu.com) but am having a lot of trouble adapting it to my needs. the problem is that when i add a rollover hyperlink to/in the page the slide show ceases to work. i hope somebody can help me with this. i have included the code with the rollover so you can see where i'm going wrong, to see the slideshow as...
by: rkagrawal | last post by:
I am not sure if this is the right forum to post about this problem , but , i just want to discuss a problem i recently encountered. I was developing a page in ASP , where i came across a problem. The last few lines of code were like this : '------ Popup page response.write("<script language=javascript>alert('Hello')</script>") response.write("<script...
by: lotus18 | last post by:
Hello World I have a problem in detecting the conflict schedule (Day and Time). Day 1. M 2. T 3. W 4. TH 5. F
by: xhunter | last post by:
I have been working on this for some time and I came to the conclusion that I have no idea what is the problem, I am sure it should be something simple that I am overlooking, but I can't figure where, I have written some classes to load the google map using google map API and a grid using extjs, here is the page : http://tinyurl.com/5clr49 and here is the classes:
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.