My goal is to make the title of every external link equal to its href attribute.
My question is, how can I make the title variable available to the attr function?
$('a').filter(function() {
var title= $(this).attr('href');
return this.hostname && this.hostname !== location.hostname;
})
.removeAttr('target')
.attr('rel', 'externa...
Hi, have you ever noticed how in gmail, as the emails are updated in your inbox, you get a hyperlink to it like so:
http://mail.google.com/mail/#inbox/23e0377656b24123
and if you click on that link it doesnt reload the page?
Can you do that with jquery and a datagrid?
So that you get links to items in your grid, which is populated as...
Hi,
Will choosing between jquery or YUI change the overall/high level design of your .js files or would it realistically only going to be the inner workings of your js functions due to the differences in framework API's? (i.e. how you access/traverse the DOM, selectors, built-in functions, firing events, etc.)
...
What's a jQuery like and/or best practices way of getting the original target of an event in jQuery (or in browser javascript in general).
I've been using something like this
$('body').bind('click', function(e){
//depending on the browser, either srcElement or
//originalTarget will be populated with the first
//element that in...
I have an unordered list with elements and I want to append an item at the end. Here is the current code:
The initial list:
<ul id="all">
<li>
Some text <input type="button" class="remove" value="-" />
</li>
<li>
Some text <input type="button" class="remove" value="-" />
</li>
</ul>
The code that removes a list item:
...
Ok, I have a set of checkboxes for selecting criteria. For argument's sake, we'll say the data looks like this:
[] Vehicles
[] Unpowered
[] Bicycle
[] Skateboard
[] Powered
[] Two-wheeled
[] Motorcycle
[] Scooter
[] Four-wheeled
etc
The []s represent checkboxes.
Ignoring the obviously ...
Hi,
I've just learnt a bit jQuery, and am trying to use it for a simple color-changing effect. Let's say I have two <div>s, #foo and #bar. #foo has a lot of URLs, and has the following CSS defined:
#foo a {color: blue; border-bottom: 1px dashed blue}
#foo a:hover {color: black; border-bottom: 1px solid black}
now I would like to cha...
I'm using the JQuery Cycle Plugin in an attempt to fade in/out images for a slide show. I am able to get it working in Firefox and Safari, however, when I view in Internet Explorer, I see very unexpected behavior.
In Internet Explorer, the cycling is happening as expected, but some of the images do not display. They simply display a r...
I have 3 divs with 2 possible image tags for each (active or inactive). If one div is clicked to be active the other divs must be set to inactive. How do I accomplish this with img tags and what happens if user has javascript disable?
...
Hey everyone,
I'm working with JQuery UI 1.6rc5 and I'm having a bit of trouble using an accordion widget. Here's the code I'm using.
<script>
$(document).ready(function(){
$('#find-panel').accordion({
header:"h3",
autoHeight:true,
alwaysOpen: false,
});
});
</script>
<div id="find-panel" class="ui-accordion" ...
I'm writing a javascript function and in "compact" javascript design fashion, the type/length of arguments changes the behaviour of the function. One possible type of the argument is a jQuery object, for which I would like very special logic.
What is the best way to test if an object is an instance of jQuery?
...
I current use prototype library to handle ajax requests. I have been on stack overflow for a week or so, and have seen lot of jQuery questions. It seems like most of people choose to use that library to handle javascript part of the programming. Beside the ajax part, rest of my javascript part on my website is developed on my own written...
A simple one, I'm trying to retrieve the value attribute of a button when its been pressed using jQuery, here's what I have:
<script type="text/javascript">
$(document).ready(function() {
$('.my_button').click(function() {
alert($(this).val());
});
});
</script>
<button class="my_button" name="button...
Hi,
I want to make scroller like given here: http://www.shopping.com/xPC-Kettler-Kettler-Vito-Xl~linkin_id-8051267
in jQuery. Its in dojo I think. Please give me link of scroller like this one.
Thanks
...
I'm loading elements via ajax. Some of them are only visible if you scroll down the page.
Is there any way I can know if an element is now in the visible part of the page?
EDIT:
freakytard solution was right, but I modified it a bit to also check if element is wholly visible
function isScrolledIntoView(elem)
{
var docViewTop = $(w...
How can I validate some inputs that are not inside a form tag?
All the samples I found have a form tag, but I want to validate some inputs that are not inside a form.
thanks!
...
Hi,
I am firing an Ajax request using jQuery. During the process, I show a loading text to the user till it reaches the success/errorhandler function. Is there a way to abort the request in middle of it. So that it doesn't goes to the success/errorHandler variable. One way I can think of is using a global variable. Is there a better meth...
How do I postback whenever a user types in a textbox to filter results in a div tag.
...
We are about to undertake a rather large customization of SharePoint and I wanted to get some feedback prior to jumping in with both feet. One of the issues we are kicking the tires on is do we deploy the jQuery javascript library to the 12 hive directly (making it available in _layouts for each site etc.) or do we wrap it up in a featur...
I've had a good look and can't seem to find how to select all elements matching certain classes in one jQuery selector statement such as this:
$('.myClass', '.myOtherClass').removeClass('theclass');
Any ideas on how to achieve this? The only other option is to do
$('.myClass').removeClass('theclass');
$('.myOtherClass').removeClass(...