Possible Duplicate:
Can jQuery provide the tag name?
Hi!
This question is so basic i am ashamed asking but i tried to find the answer for 30 minutes without any result.
How do i find out what kind of element has been clicked in the code below.
$('*').click(function (event) {
var this_element = $(this).???;
return false;
}...
A demo for sharing data between an input (id=obHid) and a textarea (id=idField)
if($.browser.msie)
$("#"+idField).text($("#obHid").val()); // IE
else
$("#"+idField).attr("value", $("#obHid").val()); // FF
Iskrahelk,
...
Hi, I have two scripts - javascript and php..
this cleans the url
<script type="text/javascript">
$(document).ready(function() {
$('.search-form').submit(function() {
window.location.href = "/file_"+ $('.search-form input:text').val() + ".html";
return false;
});
});
</script>
this is the bad word filter
<?...
Here is my jquery code:
$(document).ready(function() {
if ($('#login').length == 0) {
$('#login').css('background', "url('/css/login-bg.gif') 2px center no-repeat");
}
if ($('#password').length == 0) {
$('#password').css('background', "url('/css/password-bg.gif') 2px center no-repeat");
}
$('#login'...
I have a div that's set to overflow: auto;. This contents of this div are selectable (using jQuery UI).
When the div overflows and a scrollbar appears, the scrollbar itself becomes selectable so scrolling doesn't work well. In FF/Chrome, I can scroll the div but I get the selectable outline. In Safari, the scroll bar won't engage at all...
I am working on some auto-suggest feature.
The script is fairly itself.
When a character is typed in to the textbox it sends a ajax post (or get) request to the php file which queries the database and returns a result set.
But the problem is that the php file is accessible on its own. So it can be called directly. Is there a way to pr...
Hello
my CSS code
.child{
width:100px;
height:100px;
display:inline-block;
}
my HTML code
<div id="parent">
<div class="child">
</div>
<div class="child">
</div>
</div>
the .parent width will be 100%,but i want to make the parent width equals exactly the some of all childs, but i don't know how many chi...
Using JQuery it possible to clone a Div like this and change add a new identifier to it's ID and all it's children ID's?
For instance I'd like to be able to clone this:
<div id="current_users">
<table id="user_list">
<tr id="user-0">
<td id="first_name-0">Jane</td>
<td id="last_name-0">Doe</td>
</tr>
<tr id="user-1">
<td id="first_name...
hello
i want to use .animate function but i have some problems i want to change the 'left' value but i don't know the width of the item that i will move so if i sent to animate timer to 1000 and the width of my item is 100px that will be different if the width of my item is 500px and for the animate when it comes near the end of it's ta...
I'm working on a website concept that utilizes David DeSandro's jQuery Masonry plugin along with some code inspired by Paul Irish's Infinite Scroll plugin (I couldn't get the plugin to work so I wrote something similar myself). I've done the integration so the basic concept that I have does work.
I'm firing jQuery's .load() method when...
We are using jquery to .load() a form into a div
We then use jquery to .post() that form to a codeigniter controller ie /app/post
We then want Codeigniter to perform validation but were not sure how to return to a page to display the validation errors? If re re .load() the controller wont it re-init the object and we lose the data?
Ar...
So I am loading some Json that is transformed from RSS beforehand. This RSS has colons in it's namespaces and the conversion script doesn't strip them.
JQuery loads the json file fine, but when I try calling anything with the colon in it's name like
alert(data.rss.channel.item.kuler:themeItem.kuler:themeSwatches.kuler:swatch[0].kuler:...
I need a way to perform some kind of 'whileonmouseover' function to continue an animation while the mouse overs over an element...
For example, given this function:
$(document).ready(function()
{
function doAlert()
{
alert(1);
}
$('#button').hover(function()
{
doAlert();
});
});
The alert will...
Any ideas given the code below why the highlight is being triggered to run twice? I confirmed it's running twice using alerts which fire more than once. See anything wrong here?
//Scroll to the Anchor in the URL, if there is one
var destination = $(document.location.hash).offset().top;
$("html:not(:animated),body:not(:animated)").animat...
I have a simple AJAX jQuery command to update a shopping cart (triggered by a dropdown list box change):
$.ajax({
type: "POST",
url: $.url("updateCart"),
data: data,
dataType: "json",
success: function (data, status, req) {
alert(data + " - " + status + " - " + req);
});
It appears that in jQuery 1...
I'm trying to do a simple example using jQuerys fadeTo method. It works as expected in IE8, but doesn't fade out Chrome/Firefox 3.6. Niether the fadeTo call or the one in the button click work in chrome/ff. Any ideas?
Code:
$(document).ready(function () {
$("img, div").fadeTo("slow", .5);
$("input").click(functi...
Hi,
Why do I not see the spinner image when I run this code? However when I debug through it using firebug I do see the text/spinner image at the beginning:
<div id="spinner">
<img src="/images/ajax-loader.gif"/>
Text
</div>
<div id="events">
</div>
<script type="text/javascript" charset="utf-8">
function load_events() {
$("...
I have a jquery galleryview plugin running to display photos. i would like to add rounded corners to the photos, so i tried applying the corners plugin to the .panel holding the image. unfortunately it doesnt work. the photo starts square and then when it transitions you can see the rounding for a second and then it ends square again.
...
I'm developing web application using CodeIgniter. All this time, I put the custom js code to do fancy stuffs inside the view file. By doing this, I can use site_url() and base_url() function provided by CodeIgniter.
Today I want to separate all custom js code from view file into an external js file. Then it hit me, I cannot use site_url...
I am working on a project in asp.net c#. I need to implement horizontal scrolling content slider having image title & description in the home page.
Please suggest a good plugin/example
that can customized to solve my
problem.
Screen snapshot of my requirement
...