Hello everybody,
I want to generate html layout with areas (divs, spans) that can be shown/hidden conditionally. These areas are hidden by default.
If I call .hide method with jquery on document.ready these areas may blink (browsers render partially loaded documents). So I apply "display: none" style in html layout.
I wonder what is t...
In jQuery you can select two elements by id like: $('#elem, #elem2');
BUT
What if you have cached the elem and elem2, and what to apply the same method/function to them both?
i.e.
$elem = $('#elem');
$elem2 = $('#elem2');
This obviously wont work:
$($elem, $elem2)
Thanks!
...
The idea is that I've 3 ajax links and each link is coupled to one single element (a form). The element will be loaded in one div. Each time when you click on a different link, the element that is requested before must be removed and the new one must come in there. So it has to update the DIV. The problem is, that it request the element,...
I have this group of radio buttons in which each of individual button has of its own position set through style attribute. I would like to how can I archive the same by using drupal form api. I found how to style as whole but, not as individual control within group. Here's how my html code look like -
<input type="radio" name="base_loc...
Hello,
I need to write a function that takes a sequence of "tag" elements of the form:
<tag type="markupType" value="topic"/>
<tag type="concept" value="death"/>
...
and turns them into attributes of the form
data-markupType="topic"
data-concept="death"
So far I have the following function:
declare function local:tagsToAttrs($ta...
Hey guys,
I'm using jQuery 1.3.2 and Live Query plugin. The script needs to work in FF as well as IE6. Upgrading jQuery and using live instead isn't a possibility.
Somehow this script won't be called by the dynamically created element.
$('select').livequery('change',function(){
var select_id = $(this).attr("id"); ...
Hi All,
I am trying to add new rows in my table, and save them into DB.
First, I use .append() to append rows on the table:
$("#tablename").append("<tr id='newRow'><td>newly added row</td></tr>");
The appending function works fine. My page displays the correct result.
However, I am unable to select them with
$("#newRow").each(func...
Hi All,
I have a select box that gets cloned. I want to remove the user's previous selection from each cloned select box. Here is the method that does the clone() :
function addselect(s){
$('#product_categories > .category_block:last').after(
$('#product_categories > .category_block:last').clone()
); set_add_delete_links(); retu...
I'm trying to create a jquery setup where all instances of <i> are changed to <em>. It's easy enough to do with:
$("i").each(function(){
$(this).replaceWith($('<em>' + this.innerHTML + '</em>'));
});
But what I am having trouble figuring out is how to change all the <i> tags but retain each ones individual attributes. So if I have...
Right now, I am working with a page that is automatically updated and I'm using setInterval to check for new elements. I'd like to do this with events but I don't know how to tell if an element has been added to the page via an event.
Is this possible?
...
I am writing an 'inline translator' application to be used with a cloud computing platform to extend non-supported languages. The majority of this uses jQuery to find the text value, replace it with the translation, then append the element with a span tag that has an unique ID, to be used elsewhere within the application. The problem ar...
Which is the easiest way to get all form elements which are contained by a wrapper element.
<form name="myForm">
<input name="elementA" />
<div id="wrapper">
<input name="elementB" />
<textarea name="elementC" />
</div>
</form>
In the above HTML I would elementB and elementC but not elementA. I do not want to list all fo...
I Have a function that references a specific input text box. I would like to extend the function to be used by two specific input text boxes. Rather than duplicate the code for the other text box, can anyone advise on how to reference the other?
Here it uses #Tags, but if i wanted it to reference #Tags2 also, how could I do that?
$(...
After a bunch of animating, adding classes and setting css styles. is there an easy way to reset an element to be back in its original server delivered state?
...
I just wondered and wanted to gather together in one place all missing features of our beloved html form elements.
One example could be missing of horizontal scrollbar in a listbox. But I am sure there are a lot of features we would like to see in our form elements by default.
One missing feature per answer please.
Thank you.
...
Hello,
I believe this question has been asked a lot of times, and I have managed to overcome this problem before whenever it occurred. Just now, I feel stuck with it and can't find a proper solution to make it work in all browsers: it does work properly only in Firefox, while in IE and Safari its elements are somehow apart from each oth...
With jQuery 1.4.2, :hidden filter is not filtering out elements that were hidden, but i've made then visible by calling show(). Filter assumes it is still hidden.
Is this bug or am i missing something? Consider the following code:
$("td.ms-authoringcontrols > span[id*='_ParallelApprovers']:hidden:first").css("display")
"none"
$("td.ms-...
I know the elements versus attributes debate has come up many times here and elsewhere (e.g. here, here, here, here, and here) but I haven't seen much discussion of elements versus attributes for simple property values.
So which of the following approaches do you think is better for storing a simple value?
A: Value in Element Content:
...
Im very new to the wonder that is jquery.
and i just figure out how to make my img buttons show/hide with a opacity difference (as such)
<script type="text/javascript">
<![CDATA[
$(".ExcommKnap").mouseover(function () { $(this).stop().fadeTo('fast', 0.5, function(){}) });
$(".ExcommKnap").mouseout(function () { $(this).stop().fad...
I want to trigger the same effect than when pressing the tab key on an element that has the focus. Is there any way of doing this? I am trying to make the focus jump to the next element.
Thanks!
(jQuery is an option)
...