I am using jQuery. I'd like to get the path of the current URL and assign it to a variable.
Example URL:
http://localhost/menuname.de?foo=bar&number=0"
Is there a way to use jQuery (or generic javascript) to disable CSS inheritance on a block level? For example, if I am pulling in an external resource via javascript, say pastie.org, they will have their own CSS that my CSS overrides. I would like to place the embed code into its own container that has CSS inheritance disabled.
This is not my own CSS structure, so I can't rename IDs Classes or inline anything to make it work, the holy grail of inheritance blocking is my last resort.
I'm using json2.js to create a JSON object which JQUERY posts to the Server. The object looks like:
[{"locationID":"16","locationDesc":"XXXX"}, {"locationID":"111","locationDesc":"XXXX"}, {"locationID":"12","locationDesc":"XXXX"}, {"locationID":"11","locationDesc":"XXXX"}]
Problem here is that XXXX sometimes contains quotes like "we're'" etc.... How should I handle this? Do you I escape somewhere or encode in some way?
Thanks
Any recommendations?
I have used Jquery already but I would like to really delve into it and find out how I can use it with asp.net, specifically instead of updatepanel and ajax toolkit.
I use asp.net forms.
Why this delay of Jquery animation does not work as it should be?
$(" .inner").stop().delay(1000).animate({height:'142px'},{queue:false, duration:600});
Is there any other way to delay this animation?
I have blocks of content that are toggled on/off via jQuery and I want to have the most recent one clicked to shuffle to the top of the content area.
There are 4 that can be enabled and if you do it in a random order, or even intended order, it is hard to tell which one you just opened if it's not in the view window.
Here is the page for reference http://jonrcoulter.com/
hi,
I am creating a line in canvas tag using jquery drawing library. After the line drawn the
<div id="cool"><canvas id="canid"></canvas></div>
Then on click the below code executed.
$('#canid').remove();
What happens in IE after removing, dom with canvas end tag and also line is not removed.
Please help me out!.
Dear expert,
I have facing a problem to select span tag using jquery. Please give a solution.
code:
<ul>
<li>
<a href="#Document1">Document 1
<span id="tab_close> x </span>
</a>
</li>
</ul>
I have a requirement to place text between brackets using jQuery; the content will be updated once an action occurs e.g. search.
The structure is: -
Placeholder Text Placeholder Text Placeholder Text ()
I have a jquery code, but I'm a little bit confused on how can I put a css on this:
$(document).ready(function () {
$('span.account-menu').click(function () {
$('ul.menu').slideToggle('medium');
});
});
I wanted to add this css in the click function.
border: 1px solid #999999;
background-color: #333333;
How can I do that?
Hi there,
I'm looking for a jQuery plugin which does scrolling the element (div) when I hover the arrow, it should look like this: http://img42.imageshack.us/img42/5716/scrollp.jpg and scroll automatically the content inside to the left/right only when user hovers arrows.
Is there anything like this?
Thanks a lot, Jakub
Using the jQuery below to toggle the hiding and showing of divs of text: how would I add some sort of indicator - like an up and down arrow as a graphic - to the titles when the divs are either open and closed? What's the best way to do that? Two images? A CSS sprite? And most importantly: how would that be integrated into the JS?
I've looked at other jQuery that assigns a random number to each div and then determines which are open and which are closed and toggles one of two images. But I'm using php in a WordPress loop to show a posts, and that gives problems with incrementing in the loop, so there must be an easier way that doesn't require changes in the name of the title div. Thanks....
This JS fires the showing and hiding. Each div can be expanded and collapsed independently.
$(document).ready(function() {
$('div.demo-show:eq(0)> div').hide();
$('div.demo-show:eq(0)> h3').click(function() {
$(this).next().slideToggle('fast');
});
});
This is the HTML it works with:
<div class="collapser">
<p class="title">Header-1 </p>
<div class="contents">Lorem ipsum</div>
<p class="title">Header-2</p>
<div class="contents">Lorem ipsum </div>
<p class="title">Header-3</p>
<div class="contents">Lorem ipsum</div>
</div>
The CSS is arbitrary:
.collapser {
margin: 0;
padding: 0;
width: 500px;
}
.title {
margin: 1px;
color: #fff;
padding: 3px 10px;
cursor: pointer;
position: relative;
background-color:#c30;
}
.contents {
padding: 5px 10px;
background-color:#fafafa;
}
I am a jQuery noobie, and have been trying to add a script to change the id of a div onClick.
Here is a jsfiddle example.
$(function accept() {
$("div:scrollwrap").attr('scrollwrap','highlight');
});?
Thanks :)
I have a input that the user types a search parameter into, at the moment i have it on keyup to do a POST ajax request to a PHP script that returns search results. however its firing off 50 billion (not literally) post requests in about 10 seconds (as the user types) which slows the whole experience down. Can i use jQuery to detect a "wordup" rather than "keyup" by detecting the use of the space bar?
Does this make sense?
Hi all
I have a HTML table like below:
ColA ColB ColC ColD ColE ColF
Checked AAAA BBBB CCCC DDDD EEEE
Unchecked AAAA BBBB CCCC DDDD EEEE
Checked AAAA BBBB CCCC DDDD EEEE
Checked AAAA BBBB CCCC DDDD EEEE
Unchecked AAAA BBBB CCCC DDDD EEEE
Checked AAAA BBBB CCCC DDDD EEEE
Checked AAAA BBBB CCCC DDDD EEEE
ColA is a Check box. I want to get the ColD value of all rows whose ColA is Checked. I want to use the jquery to do it. Does anyone meet it before?
Best Regards,
Is there a way for a jQuery function to "skip" an li? Such as Having 3 list items, you click on the 1st one, it calls a next() function, and skips the 2nd li and goes to the 3rd.
Current code is here:
$('ul.gallery li').click(function() {
$(window).scrollTo($(this).next('li'), 800, {easing:'easeOutCirc', axis:'x', offset:-50 } );
});
I want it to skip the immediate li and go to the one after that.
Is it possible to define a class with specific style attributes dynamically with jQuery, rather than setting the style of all elements with that class?
I could set the attributes of the class at the end of the script once all the elements have been created, but is that the best way to go about it? If I define the style of the class with $('.class').css('property','value'); at the beginning of the script, nothing would happen because the elements with class .class haven't been created yet, right?
Hi, Disqus automatically places defined captions upon request. For example: Add new Comment
I've tried to change its value with jquery on ready():
$('#dsq-new-post h3').text('Paticipa con tu cuenta favorita');
No success :( ... how can i know when disqus script is finished parsing the data so i can change the caption value of h3?
i have long running task that gets called using jquery ajax. i am using the block ui plugin to show "loading". is there anyway i can send progress messages back to the client to show progress and have that updated on the block ui plugin message.
I know that to filter an element with an atttribute called attrName which has value attrValue I do:
filter("[attrName='attrValue']")
but looking at the docs http://api.jquery.com/category/selectors/ I can't see an option to select all elements s.t. attrNameattrValue
Will this work
filter("[attrName>'attrValue']")
I've a table that contains 3 columns. I need to bind an event that fires off whenever one of those columns is clicked using jQuery.
However, I need to know the index of the column clicked.
i.e: First column (index 0), Second column (index 1), Third column (index 2), and so on...
How can I do that?
I would like to set the width and the height of the div element dynamically using jQuery.
I was trying to replace
<div id="mainTable" style="width:100px; height:200px;"></div>
with this:
$("#mainTable").css("width", "100");
$("#mainTable").css("height", "200");
but, it does not work for me.
Please help to understand why.
i am trying to conver this (http://www.thecodemine.org/) jquery wizard into asp.net and after i create a .aspx page and copy and paste the code from .html and it does not work.... i am not sure how can i make it working.
any suggustions or feedback appreicate.
thanks.
Say I have a web component that uses jQuery and I want to distribute it as a packaged component.
I need a way to ensure that the jQuery library is available on or after the page loads, but I also want to check that the containing html page, or another unknown component that may reference jQuery hasn't already added the library to the page.
At the moment the best example I've seen is this
http://www.squidoo.com/load-jQuery-dynamically
It would need a little tweaking, but I was wondering if there were any other best practices.