Javascript help

21 views
Skip to first unread message

joshua martin

unread,
Nov 13, 2012, 5:16:50 PM11/13/12
to heatsy...@googlegroups.com
to start- I don't know jack about javascript, to the answer to my question is probably childsplay.

I am using a script someone else wrote, it works fine, and it does what I want. I am trying to integrate the script to work with the rest of my page. the script is calling a function from a text/css source, how to i make it call the same info from CSS?

i killed this in HTML:

    div.rotator ul li {
    position:absolute;


I replaced it with this in my CSS:

#rotator ul li {
    position:absolute;
}


the script is written like this:

$(document).ready(function() {       
    //Load the slideshow
    theRotator();
    $('div.rotator').fadeIn(1000);
    $('div.rotator ul li').fadeIn(1000); // tweek for IE
});


in line 4 and 5, its looking for the text/css, i want to tell it to look at CSS.

thanks guys!

Will Bradley

unread,
Nov 13, 2012, 7:41:58 PM11/13/12
to heatsy...@googlegroups.com

There's no distinction between text/html/css when you're writing this kind of thing. A CSS selector is a CSS selector. What you really did is go from using div.rotator (a div with class rotator) to using #rotator (an element with id rotator.)

You didn't post your html so I'm assuming, but you probably changed class="rotator" to id="rotator". So you'll have to use #rotator in your JavaScript now (actually jQuery.)

Incidentally, the preceding "div" is unnecessary in this case. You could probably write .rotator and div#rotator just as well.

--
 
 
Reply all
Reply to author
Forward
0 new messages