JQuery :: Make Plug-in Work On Duplicate HTML Markup But Operate Separately?
Jun 22, 2011
I inherited Javascript and jQuery for a sliding belt (carousel) module. Basically, left and right navigation arrows would appear to the sides of the belt if there were more slides to show.
The jQuery and Javascript code was originally a singleton, so I decided to convert it into a jQuery plug-in in case the belt HTML markup was instantiated more than once. We have a CMS, so multiple belt modules theoretically could be placed on the same template.
Below is test page with two belts on the same page and the associated Javascript jQuery.
My problem is that when you click on the arrows or the slides, I found that the second belt works fine but not the first one. The first one does not show a left arrow when you page to the right. Likewise, the first belt gets mixed up going to the left. Somehow, only the second belt works as expected.
What I would like to do is when I attach my plug-in to a DIV, I want each belt to operate independently of each other (i.e keep its own local variables, functions, etc.).
I am not sure what I am missing here. what I am doing wrong? (You should be able to copy and paste the code into jsFiddle to see how it currently works.)
I have the page here also: [url]
<html>
View 3 Replies
ADVERTISEMENT
May 13, 2011
how to modify the DOM with jQuery in order to correct an (dynamic) HTML structure. I have a markup like this:
Thinking about a replacewith or append or a combination??
<ul class="MyClass">
Test1 <br />Test2</ul>
But I need to get all texts in the UL be surronded by LIs, and to delete the br.
<ul class="MyClass">
<li>Test1<li>
<li>Test2</li></ul>
In real life this could be a like two text elements like in this example, but it´s dynamic so it could be like 3 or 15 or whatever sometimes.
View 2 Replies
View Related
Apr 19, 2010
I'm just starting out, and having a little difficulty understanding how to target other html markup around a certain 'on click' item.[code]So when the user clicks the anchor the text is inserted into the following textarea. I achieved this by:[code]
View 2 Replies
View Related
Nov 1, 2011
I really need this plug-in. I think I did everything exactly by the instructions,but it doesn't seem to work Can anyone take a look at the code and tell me what I did wrong?
View 7 Replies
View Related
Aug 9, 2011
Ok here is the problem I am running the cycle plugin on a webiste I am currently working on. It works in IE9 with and without compatability modeBUT in FF and Chrome no joy!!! The place where my slideshow is supposed to be is blank white. See Site [URL] Not sure what the heck is going on anymore. I had a lot of problems with this site but i fixed 90% of them by reworking my css.
View 1 Replies
View Related
May 23, 2009
I have recently noticed that version 1.3 of the jQuery Tooltip Plug-in does not work with jQuery's version 1.3.2. Is there a patch available? Is there one on the way?
View 3 Replies
View Related
Aug 31, 2010
How do I combine two plug-ins in the same HTML page? Here is my code:
<script type="text/javascript" src="jquery/jquery-1.4.2.js"> </script>
<script type="text/javascript" src="jquery.innerfade/js/jquery.innerfade.js"> </script>[code]....
I'm trying to use the fade in effect and the validate plugins. They each work independently, but when I combine them, neither one works.
View 2 Replies
View Related
Jan 27, 2011
I am calling 2 scripts, that are variations of the same script, and am getting unwanted duplicate output into the other div (place-holder) on an html page. I thought it was a scope issue, but that doesn't seem to make sense. The page is: [URL]
features.js
$(document).ready(function() {
$.get('xml/features.xml', function(f) {
$('#y-place-holder').empty();
$('#y-place-holder').append('<dl class="feature" />');
$('feature', f).each(function() {
var $feature = $(this);
var fimageurl = $feature.attr('imageurl');
var fseries = $feature.attr("series");
var ftitle = $feature.attr("title");
var fdates1 = $feature.find('dates1').text();
var fdescription = $feature.find('description').text();
var ffeature = '';
ffeature = '<dd>'; .....
View 2 Replies
View Related
Jan 28, 2011
I made this function to duplicate form elements with a little html-code surrounding the input fields. First i clone the html of the first child found (always gets rendered by php). Then, everytime the add-button is pushed, i append a cloned piece of that stored html. It's working fine except for the delete button.
It's seems that whenever a cloned html is removed, the other cloned elements aren't recognized anymore by the delete buttons (although the delete buttons are in them)
View 1 Replies
View Related
Feb 3, 2011
How to combine two functions to operate without interfering with each other?
<script>
$(document).ready(function() {
// SUCCESS AJAX CALL, replace "success: false," by: success : function() { callSuccessFunction() },
$("#form2").validationEngine({
[Code]....
View 7 Replies
View Related
Aug 4, 2010
I want to make a for loop with jQuery to reduce code, but it wouldn't work. This is the sorth of thing I want to do: run through an array of <li> and animate them separately with a pause in between.
$(
'#thebutton'
)
.click
[Code].....
View 2 Replies
View Related
Aug 4, 2010
I want to travel through a for loop of list elements with JQuery, to separately let every list element float downwards. If I do this without a for loop, it works perfectly:
Code JavaScript:
<script type="text/javascript">
$(document).ready(function() {
$('#menu li').animate({ "opacity": "0", "marginTop": "-300px" },0);
$('#thebutton').click(function(){
var items = $('#menu > li');
$(items[0]).delay().animate({ "opacity": "1", "marginTop": "2px" }, 400);
[Code]...
View 2 Replies
View Related
Feb 21, 2010
I want frmId to operate as a variable in this line:
Code:
Is this possible?
frmId is generated via this snippet:
Code:
I've tested 'frmId' prior to running this portion of the script, and it is pulling the form id correctly.
I can post the whole script if necessary, but I figure this is probably either just a syntax issue or that I'm trying something that's not possible.
View 9 Replies
View Related
Feb 7, 2010
I have a (not too long) paragraph. In this paragraph a few words are wrapped with <span class="emphasize_m"> and <span class="emphasize_xl"> What i want to do is wrap all words in <span> which aren't wrapped already.Then i want to switch all span opacities to 0 (zero).I don't have an idea of how to wrap words separately.
View 6 Replies
View Related
Jul 30, 2010
let's say I have this code markup:
<div id="id1">
This is some text
<div class="class1"><p>lala</p> Some markup</div>
</div>
What I would want is only the text "This is some text" without the child element's .class1 contents.
How would I do that? A normal selector would select "recursively", so how do I limit it to one level?
View 4 Replies
View Related
Feb 4, 2010
I have been trying to figure out how to find all instances of a certain word or phrase within an element and wrap those words in <span> tags or other html. I.e. change all instances of 'the keywords' to <span>the keywords</span>So far I've found a lot of references to :contains() but that will change the element the text is inside of rather than just the text itself
View 2 Replies
View Related
Feb 10, 2011
On my site I use an SVG image. The <embed> tag works fine in Opera and Firefox. And <img> works fine in Chrome and Safari. I would like to know if it is possible to change the tag with an 'if' browser statement, and if it is ho would I write it.
if (jQuery.browser.webkit) {
* // Replace <embed> with <img>
}
View 2 Replies
View Related
Aug 23, 2009
I have a js application, that loads formular-markup dynamically for a specific entity. Is there a way to access elements within this dynamically loaded markup through jquery?
eg.
in the form load function:
$('#container').empty().append($(entityForm.markup).addClass
("formContainer"));
[Code].....
View 1 Replies
View Related
Oct 1, 2010
I have an application that produces a dynamic unordered list from DB categories table. The list is representing the hierarchy by adding a “..” (Double dot) in front of the list item name for each hierarchy level like so:
<ul id="categories">
<li>Cat1</li>
<li>..Cat1a</li>
<li>..Cat1b</li>
[Code].....
View 10 Replies
View Related
Mar 9, 2011
I have html code:
<div id="dropdown" class="rMenu">
<ul id="middlemenu" class="rMenu-hor rMenu">
<li><a href="page.html">Page</a></li>
[code]....
View 1 Replies
View Related
Nov 29, 2006
Right now, the array items print out without spaces like "Jane,John,Mary,Sue". I need to be able to work with the items individually so I can format them so they read "Jane, John, Mary and Sue". I thought I'd be able to do something like v[i] + ", " but I get an "undefined" when I try to alert for v[i]. Can someone point me in the right direction? Code:
View 17 Replies
View Related
Aug 11, 2006
I've been working on a Spin Control that uses only a standard textbox. <input type="text" /> With Javascript enabled the textbox looks and acts like a spin-button control without adding any extra elements. [URL] The up/down arrows are achieved using a background image, the rest is handled by Javascript/JQuery. I hope it is useful for some of you. I'm also working on a drop down date-picker that uses similar principles. (I just don't like solutions that add loads of extra markup!) Feedback/comments are welcomed, though I won't be able to respond to
View 12 Replies
View Related
Oct 17, 2010
I'm new to jQuery, but learning fast, and loving the new functionality!I'm using a Flash upload component that all works fine, and once it's complete (file uploaded) it calls function.I'm running the Flash upload in a modal (nyroModal - very cool!). The link below does what I need it to do - navigate to a new page and re-size the modal:<a href="test2.aspx#blabla" class="nyroModal">Ajax Filtering Content #test</a>What I need to work out is how to make the JS function above work in the same way as this link. I know very little JS, but I think the 'class="nyroModal" needs to be part of the link in the function some how??
View 3 Replies
View Related
Jan 7, 2011
The following code works fine in Firefox, but in Chrome (und IE as I read) nothing happens:
How can I make that work in IE?
View 4 Replies
View Related
May 19, 2009
In one of our files we with a <marquee> tag.
But to get the contents of this file, were using jquery ajax.
Does anybody know how I get make the <marquee> work from the ajax?
In Chrome its fine, but if its in Firefox, the text displays, just not in a marquee.
View 2 Replies
View Related
Jun 29, 2009
For example, slideUp just results in my SWF pausing for a moment, and then disappearing, without any sliding effect. Is there any way to get this to work?
View 1 Replies
View Related