Hi all, fairly new to jQuery. I read a similar post here this morning, but it wasn't quite the same as my issue so I opened a new post.
Here's what I'm trying to do: I have a page with 4 tabs. Clicking a tab invokes AJAX so the tab content changes. This works.
In the first tab which is called "Featured", I'm using the jQuery cycle function to rotate through 3 featured articles in DIVs. Only on this tab though. The other tabs don't use the cycle function, or any other jQuery feature.
When the page loads the first time, "Featured" is on and the jQuery cycle works great. At this point, the event is firing in the document header, not in AJAX.
- <script type="text/javascript">
$(document).ready(function() {
$('#case_content').cycle({
speed:1000,
timeout:9000
})
});
</script>
My problem is that if I click off the Featured tab, then come back to Featured, the "$" function isn't being recognized. "$ is not a function" shows in the error console. Thus, the DIVs do not rotate
In the AJAX event handler that determines what tab is selected via a switch statement, I added the following code:
switch (currentTab) {
case "featured":$ (function() {
$('#case_content').cycle({
speed:1000,
timeout:9000
})
}
)
break;
I still get the error that $ is not recognized. I gather that jQuery is not firing because the document is already loaded?
I feel like I'm missing something basic. Do I need to dynamically load, or include, jQuery in the switch statement? Thanks for any help...