Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Problem z dwoma skryptami na stronie, java script
Thuunder
post
Post #1





Grupa: Zarejestrowani
Postów: 234
Pomógł: 1
Dołączył: 29.10.2004

Ostrzeżenie: (0%)
-----


Witam!
Mam problem z javascriptem. Mam stronkę, która ma jeden skrypt który powstał automatycznie w photoshopie(wklęsłość i wypukłość) i dodałem drugi skrypt,który działa na "zwykłej stronie". Gdy podpiąłem go do nowej strony, skrypt photoshopa przestał działać. Z czego to może wynikać?
ps. bez siebie skrypty działają

Ten post edytował Thuunder 1.12.2004, 23:10:21


--------------------
najprostsze rzeczy są najmniej oczywiste
Go to the top of the page
+Quote Post
revyag
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 258
Pomógł: 16
Dołączył: 21.09.2004
Skąd: Kielce

Ostrzeżenie: (0%)
-----


Wiesz, troche trudno tak zgadywać, jakiś link do strony albo kod by się przydał smile.gif


--------------------
-------------

------
Go to the top of the page
+Quote Post
Thuunder
post
Post #3





Grupa: Zarejestrowani
Postów: 234
Pomógł: 1
Dołączył: 29.10.2004

Ostrzeżenie: (0%)
-----


Kod
<script TYPE="text/javascript">
<!--

function newImage(arg) {
        if (document.images) {
                rslt = new Image();
                rslt.src = arg;
                return rslt;
        }
}

function changeImages() {
        if (document.images && (preloadFlag == true)) {
                for (var i=0; i<changeImages.arguments.length; i+=2) {
                        document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
                }
        }
}

var preloadFlag = false;
function preloadImages() {
        if (document.images) {
                index_G__home_over = newImage("images/index_G--home-over.gif");
              
                preloadFlag = true;
        }
}

// -->
</SCRIPT>
          <script language="JavaScript1.2">
function marque()
{

var marqueewidth="100px"
var marqueeheight="240px"
var marqueespeed=1
var pauseit=1

var marqueecontent='<p align=center><img src=""logo.gif"></p>'

marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
var actualheight=''
var cross_marquee, ns_marquee

function populate(){
if (iedom){
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
cross_marquee.style.top=parseInt(marqueeheight)+1+"px"
cross_marquee.innerHTML=marqueecontent
actualheight=cross_marquee.offsetHeight
}
else if (document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee2
ns_marquee.top=parseInt(marqueeheight)+1
ns_marquee.document.write(marqueecontent)
ns_marquee.document.close()
actualheight=ns_marquee.document.height
}
lefttime=setInterval("scrollmarquee()",20)
}
window.onload=populate

function scrollmarquee(){

if (iedom){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+1+"px"
}
else if (document.layers){
if (ns_marquee.top>(actualheight*(-1)+8))
ns_marquee.top-=copyspeed
else
ns_marquee.top=parseInt(marqueeheight)+8
}
}

if (iedom||document.layers){
with (document){
if (iedom){
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
write('<div id="iemarquee" style="position:absolute;left:0px;top:0px;width:100%;">')
write('</div></div>')
}
else if (document.layers){
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee">')
write('<layer name="ns_marquee2" width='+marqueewidth+' height='+marqueeheight+' left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
write('</ilayer>')
}
}
}
}
</script>


--------------------
najprostsze rzeczy są najmniej oczywiste
Go to the top of the page
+Quote Post
revyag
post
Post #4





Grupa: Przyjaciele php.pl
Postów: 2 258
Pomógł: 16
Dołączył: 21.09.2004
Skąd: Kielce

Ostrzeżenie: (0%)
-----


Nie wiem jak używasz tych skryptów, ale pierwsze co zrób to umieść wszystko między jednym znacznikiem określającym skrypty javascript. Bo masz rozdzielone teraz je na dwie części.
Kod
<script type="text/javascript>
    function newImage(arg) {
    ....
    }
    function changeImages() {
    ....
    }
    function preloadImages() {
    ....
    }
     ....
    function marque{
    .....
   }
</script>

jak się nic zmieni, to pokaż jak używasz tych funkcji.


--------------------
-------------

------
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 07:14