What makes it rotate?

If I have a website powered by wordpress, that has a main featured slider on the home page that rotates, what is it that makes it rotate?

I’ve been told it’s javascript but is that what actually makes it rotate or is that jquery or what is the difference and can I see this by " inspecting elements " in the browser?

w/o knowing the specific code that question is hard to answer.

Generally the following techniques are employed:

  1. for random STATIC images, WP may be using a PHP script. Building an array of image URLs, then using rand(0, count($your_array)-1); to pick an image at random.
  2. if its a SLIDE SHOW. then you do need .js of some sort. If this is the case ALL your images are present ALL the time and the scripts merely changes the position of the images to make one visible over the other (usually by changing CSS classes). If you were to turn off CSS and JS you SHOULD(not necessarily tho) see your entire slide show displayed as a plain list of images. the .js is probably executing on timeout(), to rotate the images at an interval. On your HTML try to locate this list ( or a DIV reaped around it) and see what ID/or class it has. You can then inspect your jQuery selectors for code that target that element or .js getElementByID(‘that elements ID’)
  3. the other method, tho I cant think why WP would use this , employs AJAX. That is , the javascript is calling another document(page) and replacing it to create the slides. This method would not be as easy to spot simply by looking at view source or inspecting the element.

Hope that helps

Brilliant, it is as you said in #2. How enlightning, many thanks

jQuery is a library of functions that is written in JavaScript to perform common tasks that saves people with a reasonable but not expert level of JavaScript knowledge the trouble of creating their own library. You need a reasonable level of JavaScript knowledge to be able to use jQuery properly and if you have a high level of JavaScript knowledge you will likely have already created your own equivalent library and so would not need the jQuery one.

For fading systems I use my own jQuery code but for a quick sliding banner system I use the jQuery Slides plugin. Have a look at it here: http://www.slidesjs.com/

This thread has inspired me to take a developers course. After paying for a certified web developers course, I found out that there is no regulartory certificate for this field. Is this correct?

None that I know of. Lots of technical colleges offer courses around here but they are only certified by themselves so… Not an industry standard by any stretch.

Just started my js course, I havn’t got a clue what they are taking aboout. I’m hoping it will all become clear in time

Well, I suppose it all depends on what they are teaching you in the course. Web development takes shape in a variety of disciplines:

1) HTML/CSS/Javascript - Primarily has to do with the user interface. This is called client side code.

2) PHP, ASP.NET, Coldfusion, Classic ASP, Java Server Pages are server side technologies that run on the server and generate/serve client side code.

3) MySQL, MS SQL Server, Access, SQL Lite, etc… are some of the databases that the server side code is used to store and retrieve data (content) on websites

4) WordPress, Drupal, Joomla, Concrete5, Expression Engine, etc… are content management systems built upon the above three items to automate the process of building and maintaining modern websites.

In my daily routine, depending on what I’m doing, I will typically write a smattering of PHP code, plus database SQL queries which will then be rendered as HTML often using Javascript and CSS to make the display more intuitive.

My suggestion for someone new to the whole web development world would be to concentrate and master one area first. For instance, learn HTML/CSS so that you can look at a complex layout and intuitively know how you will render it as HTML using CSS to control how it all fits together; using background colours and css-gradients & opacity to manage drop shadows or overlaping areas.

Once you’ve mastered that, I would suggest looking at using Javascript (one of the libraries like jQuery) to add some pizzazz to your layouts. I often use jQuery to display/hide messaging, validate forms or build tabbed catalogue pages.

Also get a good book about PHP/MySQL to learn about how server-side code and databases interact to produce pages like the this forum page. Sitepoint has a ptretty good book right here: http://www.sitepoint.com/books/phpmysql5/

Thanks for the good advice - sitepoint has really been helping me with my html and css so I’m getting more confident and getting a good understanding with it now. the js part of the course has just gone right over my head at the moment so I jumped the the php part as I’m more familiar with mysql and myphpadmin etc. Can you give me an example of a java scripted page as opposed to one that isn’t javascripted to give me a better idea as to what it does and why and when I would use it?

Well, there are all sorts of reasons why you would use Javascript in a web page. Most often it is used to add some interactivity to a page; for instance to add a mini-calendar for a date field or to show and hide areas in a FAQ (frequently asked questions) section… That sort of thing. I also use it on occasion to call server-side scripts behind the scene to interact with the database or a web service and pull up results without having to do a full page request. That sort of thing is commonly known as an AJAX request.

I used to write my javascript from scratch but now that Javascript libraries like jQuery, Dojo, YUI and many others are so well supported it just makes sense to grab one and learn it. The benefit of a library is that it abstracts a lot of the work involved in writing code to do something into a short concise statement and the library handles most browser compatibility issues, leaving you to write more maintainable code.

I chose jQuery because it is relatively easy to latch on to and there is a lot of documentation about it on the web with examples of working code: http://jquery.com/