jquery-attributes

jQuery progressbar on changing image .attr('src')

て烟熏妆下的殇ゞ 提交于 2019-12-13 15:44:25
问题 I have an image declared in HTML as: <img src="images/image_01.gif" id="man_img_file" width="400" height="300" alt="image_01" /> I'm changing the image through jQuery: $('#man_img_file').attr('src', "images/image_02.gif"); Now I want to display a percentage progress bar while the image loads (ie. while the new src image loads through jQuery). How can this be achieved? Can it be done using the jQuery progressbar? Note: The images are already in the server and I can get the image size through a

Jquery Disable option in dropdown

﹥>﹥吖頭↗ 提交于 2019-11-30 20:19:45
Guys i have used the following code to disable an option using jQuery ( jquery-1.4.2.min ).The disable happens in Firefox , but not in IE. <SELECT NAME="SCOPE" id="SCOPE"> <OPTION VALUE="G"> Global <OPTION VALUE="D"> Dynamic </SELECT> $("#SCOPE option[value='G']").attr("disabled","disabled"); $("#SCOPE option[value='D']").attr("selected", "selected"); I think i might be wrong but it could be because the select rather than option can be disabled. Since firefox is great and IE sucks, well you can guess why :) you having that problem. Use css to grey out the text of that option. then on jquery do

Jquery Disable option in dropdown

本秂侑毒 提交于 2019-11-30 04:22:32
问题 Guys i have used the following code to disable an option using jQuery ( jquery-1.4.2.min ).The disable happens in Firefox , but not in IE. <SELECT NAME="SCOPE" id="SCOPE"> <OPTION VALUE="G"> Global <OPTION VALUE="D"> Dynamic </SELECT> $("#SCOPE option[value='G']").attr("disabled","disabled"); $("#SCOPE option[value='D']").attr("selected", "selected"); 回答1: I think i might be wrong but it could be because the select rather than option can be disabled. Since firefox is great and IE sucks, well

jQuery data() returns undefined, attr() returns integer

爷,独闯天下 提交于 2019-11-27 13:00:49
I have the following code: alert($embellishment.data("embellishmentId")); alert($embellishment.attr("data-embellishmentId")); The first alert returns undefined , whereas the second alert returns an integer, 3 . -- SEE DEMO -- I'm using jQuery version 1.7.2 ( data was added with version 1.4 I believe) Why is this? Should I be using data() at all if its not returning the right values? OK. I found the problem by interpreting jQuery docs . When you write: $embellishment.data("embellishmentId"); it is handled by jQuery as compound attribute: <div data-embellishment-id="3"></div> So, to solve the

jQuery data() returns undefined, attr() returns integer

故事扮演 提交于 2019-11-26 18:15:12
问题 I have the following code: alert($embellishment.data("embellishmentId")); alert($embellishment.attr("data-embellishmentId")); The first alert returns undefined , whereas the second alert returns an integer, 3 . -- SEE DEMO -- I'm using jQuery version 1.7.2 ( data was added with version 1.4 I believe) Why is this? Should I be using data() at all if its not returning the right values? 回答1: OK. I found the problem by interpreting jQuery docs. When you write: $embellishment.data("embellishmentId"

jQuery .attr(“disabled”, “disabled”) not working in Chrome

帅比萌擦擦* 提交于 2019-11-26 17:41:33
Not sure why this isn't working. When people click the 'edit' button of my application, the disabled textfields become editable: $("#bewerken").click(function(e) { $("input[disabled='disabled']").removeAttr('disabled'); }); I then want to disable the textfields again when the user saves; I have this code bound to my save button: $("#save_school_changes").click(function(e) { //stuff $.ajax({ type: "POST", url: "/school/save_changes", data: { //stuff }, success: function(data) { $("#feedback_top").html("<p>" + data['message'] + "</p>").slideDown('slow').delay(2000).slideUp(); $("input[type='text

jQuery .attr(“disabled”, “disabled”) not working in Chrome

﹥>﹥吖頭↗ 提交于 2019-11-26 06:39:18
问题 Not sure why this isn\'t working. When people click the \'edit\' button of my application, the disabled textfields become editable: $(\"#bewerken\").click(function(e) { $(\"input[disabled=\'disabled\']\").removeAttr(\'disabled\'); }); I then want to disable the textfields again when the user saves; I have this code bound to my save button: $(\"#save_school_changes\").click(function(e) { //stuff $.ajax({ type: \"POST\", url: \"/school/save_changes\", data: { //stuff }, success: function(data)