Quantcast
Channel: Targeting a div id in javascript with a function - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Targeting a div id in javascript with a function

$
0
0

I'll get right into it, kind of a newbie here.

I have a slideshow running on jQuery that also holds text based content in it as well (we'll call this slider "main slider"). When you slide through, the content changes (obviously). What I'm trying to do is put another smaller slider we'll call this "secondary slider" into one of the larger slides on main slider to showcase some photographic content.

I'm having issues.

I can get the secondary slider to work on the same page as the main slider but I'm encountering issues when I "embed" it into the main slider. I'm sure it has something to do with the way the plugin is targeting the div. Here is the markup:

<div id="img4" class="ctnsec"><div class="slidecontent"><div class="graphicleft"><ul><li style="float:left;line-height:55px;"><p class="topcopy">GRAPHIC DESIGN</p></li><li style="float:left;padding-left:100px;line-height:38px;"><p class="botcopy">SEE THE DIFFERENCE</p></li></ul><div class="clearme"></div><p>Lorum Ipsum</p></div><!--graphicleft--><div id="banner-slide"><ul class="bjqs"><li><img src="images/logos/crust.png" alt="under the crust" title="under the crust" /></li><li><img src="images/logos/space_la.png" alt="space la" title="space la" /></li><li><img src="images/logos/black_cat.png" alt="the black cat" title="the black cat" /></li><li><img src="images/logos/sia.png" alt="social investment advocates" title="social investment advocates" /></li></ul></div><!--banner-slide--></div><!--slidecontent--></div><!--img4-->

And here is the plugin javascript that gets included on the page:

jQuery(document).ready(function ($) {    $('#banner-slide').bjqs({        animtype: 'slide',        height: 300,        width: 400,        responsive: true,        randomstart: true    });});

Alright, so you see how the plugin is targeting the div id of "banner-slide" with a class of "bjqs? I need to know how I can tell the plugin that I need to target those same things BUT within the div id of "img4". Is there an easy way of going about this?

Thanks in advance for the help, I really appreciate it!

-Patrick


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles



Latest Images