Setting an autostart on page load


show more Setting an autostart on page load provides you with in-depth training on Developer. Taught by Chris Converse as part of the Create a Sliding Tabbed Panel with jQuery and Dreamweaver show less
please wait ...

Setting an autostart on page load

Now we want to have the sliding panel automatically open on page load, so let's come out of Life view. Let's switch over to sliding_panels.js. Let's scroll up to the top of the document, and we are going to create a new variable up here. So after panelWidth, we're going to type var space startPanel. Let's set that equal to 2, then a semicolon. Now, we are going to be using jQuery's nth-child, which starts at 1, so setting this to 1 will start the first panel, 2 and then 3.

So to sort of autostart this, now that we have that variable created, let's scroll down. After the instruction to set a click event on all the spans, let's hit a few returns. Make sure you're still inside of the document ready. We'll type dollar sign, parentheses, tick marks inside for a string literal, .sp, space, .tabs, space, span:nth-child, another set of parentheses, inside of the parentheses for nth-child, two more tick marks, two plus signs.

Now, inside of the plus...

Setting an autostart on page load
Video duration: 3m 16s 1h 6m Intermediate

Viewers:

Setting an autostart on page load provides you with in-depth training on Developer. Taught by Chris Converse as part of the Create a Sliding Tabbed Panel with jQuery and Dreamweaver

Subjects:
Developer Web
Software:
Dreamweaver jQuery
Author:
please wait ...