I'm new to jQuery and really liking it. I'd like to know if there's an effect similar to IE's in which I can convert images to grayscale in the runtime?
I have a background colour set on a series of buttons, .button1, .button2., .button3 & .button4. Each of these buttons has a different background colour set in CSS.
I want to use jQuery to detect the background colour of the button when it is clicked and apply that colour to .toolbar.
Is this possible?
I am working on asp.net and c#.
I am using lots of ASP and HTML controls on the page and in some cases all the controls gets disabled.
Some of the used Controls are:
RadioButton
RadioButtonList
CheckBox
CheckBoxList
TextBox
DropDownList
Button
etc...
I need a Simple and short method to disabled all the Controls when i call this jQuery method on some condition.
Any Help?
Thanks in Advance...
Hi everyone,
I'm trying to create a simple thumbnail viewer with jQuery. Here goes the code:
$(function(){
$("ul.thumbnails li").click(function(e){
var imgAlt = $(this).find('img').attr("alt"); //Get Alt Tag of Image
var imgTitle = $(this).find('a').attr("href"); //Get Main Image URL
$("img.featured").attr({ src: imgTitle , alt: imgAlt}); //Switch the main image (URL + alt tag)
});
<div class="image-gallery">
<img class="featured" src="big.jpg">
<ul class="thumbnails">
<li id="thumb01">
<a href="big.jpg"><img src="small.jpg"></a>
</li>
<li id="thumb02">
<a href="big.jpg"><img src="small.jpg"></a>
</li>
<li id="thumb03">
<a href="big.jpg"><img src="small.jpg"></a>
</li>
</ul>
.thumbnails li {
margin: 0;
padding: 5px 5px 0 5px;
list-style: none;
float: left;
overflow: hidden;
}
thumbnails li img {
width: 50px;
height: 50px;
margin: 0;
padding: 0;
float: left;
}
If i click the thumbnail, the browser goes straight to the full image instead of just changing the img src with jQuery. But I if i click somewhere inside the <li> it works.
I know this must be simple, but I don't know where I'm going wrong. I've tried studying other galleries, like http://www.sohtanaka.com/web-design/examples/image-rotator/ , but couldn't find what I'm missing.
I could really use some help from you guys :)
Is there any place where I can find JQuery video tutorials from novice level to master level? The books I saw mostly assume you are very familiar with CSS syntax. If there is any video tutorial resource for CSS, that would be awesome too.
I'm trying to call the jQuery text() function and run it through the trim() function to remove all trailing and leading whitespace. Seems to work great in Firefox, however, does not work in IE7 (refuses to remove a space trailing at the end).
Any ideas?! Maybe a regex solution?
I have this wordpress blog that has many pages with subpages that dropdown on hover.... the thing is, I dont want the pages that you hover to link to anything unless they dont have any ul with many anchors inside so just the subpages will have a href different than "#"
So basically Im hacking my way through this with some simple javascript.
jQuery(document).ready(function(){
jQuery("#menus li > a").attr("href","#");
});
This is selecting every a.. and I dont want that... I just want the anchors that are main pages, not subpages... heres the html so maybe you can think of a better way to select this.
Ill explain first
the structure is
an ul with many li that have an anchor inside
if the li also has a ul inside then those are subpages that will appear on hover.
hence the initial anchor should have href="#"
if there is no ul inside the li then the li a should keep its href.
<ul id="menus">
<li>
<a href="somelink">Main Page</a> //href should be changed to #
<ul>
<li>
<a href="somelink2/">Subpage1</a>
</li>
<li>
<a href="somelink3">Subpage2</a>
</li>
</ul>
</li>
<li>
<a href="somelink">MainPage-with-no-subpages</a> //href should not be changed
</li>
<li>
<a href="somelink4">MainPage</a> //href should be changed to #
<ul>
<li>
<a href="somelink5">Subpage</a>
</li>
<li>
<a href="somelink6">Subpage</a>
</li>
</ul>
</li>
</ul>
Hi folks. I was kindly helped by fudgey earlier. Unfortunately the solution doesn't work in IE. Here is the original post:
http://stackoverflow.com/questions/2768141/expand-div-with-focus-jquery
and here is his demo (also doesn't work in IE):
http://pastebin.me/6561cd9a033a5f16940ae12f813e938c
Any idea on how to make this work there?
Thanks!
I have this element:
<div class="isthisyou" id="unique_identifier"></div>
I want to use jQuery to insert a link into the div:
$('isthisyou').append('<a href="auth/create_account/'+this.id+'">Is this you?</a>');
Right now this.id is returning undefined instead of unique_identifier. What am I doing wrong?
Thanks!
I am using this jQuery plugin
It is very nice, but I can't seem to figure out how to get it to auto-play. (automatically transition to the next image at an interval)
Has anyone else gotten this to do that?
I'm using UpdatePanel to asynchronously call a button click event in a page that calls a method in another class which writes out an XML file on the output. Is there a way to do this with JQuery instead of UpdatePanel?
hi,
I'm using qTip jquery-plugin for my tooltips.
I cannot change the font-size of the tooltips. This is the code.. any number 2..4..8 produces the same results.
$('.option img[title]').qtip({
style: { name: 'light', border: {width: 0}, title: { 'font-size': 2 } },
position: {
corner: {
target: 'topMiddle',
tooltip: 'bottomMiddle'
}
}
});
thanks
In Prototype I can show a "loading..." image with this code:
var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars,
onLoading: showLoad, onComplete: showResponse} );
function showLoad () {
...
}
In jQuery, I can load a server page into an element with this:
$('#message').load('index.php?pg=ajaxFlashcard');
but how do I attach a loading spinner to this command as I did in Prototype?
Hi guys, I used jQuery tools to create a tabs setup, and I would like to incorporate the fade effect, but when I try to do so, it bombs out, here is my code:
$(function() {
$("#flowtabs").tabs("#flowpanes > div", { history: true, effect: 'fade' });
});
I am assuming that it's because I am also enabling the tabs history?
I am kinda new to all of this, so please be patient! :-)
Thanx in advance!
Is there any way to handle exceptions thrown from AJAX callbacks in jQuery, other than adding a try..catch block to each callback? The error function is not called in this situation.
$.ajax(
{
url: 'myurl.rails',
success: function( data )
{
throw 'Oh no!';
},
error: function ( xhr, textStatus, errorThrown )
{
console.log( 'AJAX call failed', xhr, textStatus, errorThrown );
}
} );
I have an array (for checkboxes) that I need to pass alongside the regular form in an ajax post, but can't seem to get this to work:
new_data = [a,b,c,d,e];
somedata_assoc = JQuery.param({'choices[]': new_data});
$.ajax({
type: "POST",
url: contract_qurl,
data: $(div).find("form").serialize()+"&"+somedata_assoc,
context: $(this),
success: function(data) { $("#results_table").html(data); }
});
I have several javascripts at the head of my document, as well as at the bottom, near the body closing tag. I use jQuery to call an ajax element into place and the elements that are called, require these javascripts to function. How can I include these javascripts to work with the ajax call?
I need a jquery script section that checks to see if the first digit of a textbox entered number string is a '0' and eliminate it if so. For example "044055" needs to become "44055"
I am successfully posting a form via ajax, using the following code;
$.post( "Page.do?source=ajax",
$("#Form").serialize(),
function(data){
}
The data response that comes back can be alert'd. I can see that it is the HTML of the entire form, having been submitted. But, I am having trouble accessing an element in that form which has come via ajax, ie
data.find('.Errors').html()
or
$('.Errors', data).html()
Do I need to somehow convert the text into a DOM which can then be parsed by jQuery?
Anyone know of a working sample of jquery axax post with validation messages being returned from the server that highlight the relevant form fields?
Should the form be a partial view? Is it possible to make use of modelstate?
Cheers
Hello,
I would like to pass to a jQuery function a regular function, instead of the usual anonymous function, but I'm not sure how such a thing could be done.
Instead of this:
function setVersion(feature) {
$.post("some.php", { abc:"abc" },
function(data){
// do something here
}, "json");
}
I would like to do this:
function foo(data){
// do something here
}
function setVersion(feature) {
$.post("some.php", { abc:"abc" }, foo, "json");
}
Thank you.
Hi,
I have a problem, maybe due to TinyMCE.
I want to put a text in a markup with jQuery.
This is my code :
$(".page").change(function(){
tinyMCE.triggerSave(true, true);
$(".description").val("my text");
});
Have you an answer to this ?
Hi guys,
I'm trying to write a jQuery function to change out href of a link, but I'm not quite sure how to do it. I've implemented a slider, but I have a link which lives outside of the slider (outsideLink) which needs to change as the slider changes.
I'm trying to achieve the following:
for each link in sliderList
get currentLink.href
outsideLink.href = currentLink.href
wait 3 seconds
repeat
end
I'm not sure how to implement the delay when I'm going through a list of items though.
I'm looking to show a ColorBox Dialog, using the code
$(document).ready(function()
$(".colorbox_dialog").colorbox();
});
When the url parameter ?dialog=yes is passed. How can I do this in jQuery 1.3+?