jquery-selectors

ipad disable select options w/o jquery

喜你入骨 提交于 2019-12-12 20:47:43
问题 There is a way,plugin or code snippet that i could use to make <select><option disable="disable">....</option></select> options in safari on ipad to be disabled ? latter edit: here is the code: function getSelectedValues(ids) { var selectedValues = [] , $selected = $('.selector').children('option:selected'); $selected.each(function(){ if(this.value != 0){ if(ids == true){ selectedValues.push(this.value+'-'+$(this).parent().attr('id')); } else { selectedValues.push(this.value); } } }); return

jQuery .has(“:focus”) in FF/Chrome/Safari

巧了我就是萌 提交于 2019-12-12 18:22:23
问题 I have a textbox that has filter as you type results below it. I have jQuery that detects when focus leaves the textbox so it can hide the results div. BUT I don't want to hide the results if the results are click on so that I can use that click to redirect to a different page for that item. I'm using .has(":focus") to check if my results div or any of its children have focus. My problem is that this only works in IE as far as I can tell. Anyone know why? $("#TextBox").blur(function () { if (

Filter table rows based on select value

你离开我真会死。 提交于 2019-12-12 17:21:15
问题 I need to filter table rows based on select value. When selected value is "" (empty) table must be hidden. If select value is lets say 1, table must be visible and it must show only rows where first table column hold value 1. The problem is that this id column hold multiple ids like 1,2. Since my JQuery skill are not the best i need you guys to help me complete my code My selector <select id='mySelector'> <option value="">Please Select</option> <option value='1'>A</option> <option value='2'>B

jquery: use “letters” as an id

半城伤御伤魂 提交于 2019-12-12 17:17:46
问题 I'm building menu that will show a list of letters and than load the proper page according to what user has selected. I'm able to load one letter, but how could i use "letters" as an id so i don't need to duplicate the same jquery code for each letter. <div id="idshow"><a id="hidelinks" href="#">Hide</a> <br /><br /></div> <div id="letter_a"><a id="success_a" href="#">A Show</a></div> <div id="letter_b"><a id="success_b" href="#">B Show</a></div> <div id="letter_c"><a id="success_c" href="#"

jquery find .html() equal to val();

℡╲_俬逩灬. 提交于 2019-12-12 17:10:08
问题 I have an ajax form and I need to locate the 5 digit zip entered. -- val(); var zip = ($("#edit-field-zip-value").val()); After submit, results are loaded in a table with upto 10 zips. Within the 10 zips, one needs to be identified with jquery. $(".zip div:html[text=zip]").addClass("equal"); The above line is obviously incorrect. Can someone help out with here. If it isn't possible with my line of jquery, I am open to another more flexible solution. ex: if (zip == tablezip) { console.log(

PhantomJS/CasperJS AssertExists() is failing

≡放荡痞女 提交于 2019-12-12 16:44:05
问题 I am trying to check wether a selector exists in my webpage but casperjs never finds it. I've tried two approaches: 1. Without waiting casper.then(function() { // search for 'casperjs' from google form this.test.assertExists('#search-form', 'the element exists'); // this.test.assertExists('.glyphicon.glyphicon-plus', 'the element exists'); }); 2. Waiting for selector casper.waitForSelector('#search-form', function() { this.echo("I'm sure #search-form is available in the DOM"); }); 3. Another

jquery mobile page injection

时光怂恿深爱的人放手 提交于 2019-12-12 15:33:49
问题 I have this simple html (I am hosting my own files and it works) <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="JQM/jquery.mobile-1.0.1.min.css" /> <script src="JQM/jquery.js"></script> <script src="JQM/jquery.mobile-1.0.1.min.js"></script> <script src="pages.js"></script> </head> <body onload="main_page();"> <div data-role="page"> <div data-role="header"> <h1>My Title</h1> </div> <div id=

How to select this container element in jQuery

青春壹個敷衍的年華 提交于 2019-12-12 14:25:16
问题 I having trouble to select the currently clicked container element. My Html <div class="cparent"> foo1 <a href="javascript:void(0);" class="delete">Delete</a> </div> <div class="cparent"> foo2 <a href="javascript:void(0);" class="delete">Delete</a> </div> I mean when I click on delete link, corresponding container should disappear. How can I do this? What I tried ! $(".cparent",this).html('Deleting...').delay(1000).fadeOut();// not working My script $(".delete").live("click",function(){ var

using minicolors jquery

一个人想着一个人 提交于 2019-12-12 14:25:03
问题 Ive been trying to impliment minicolors. Everything is fine and i have positioned it the way i want but there are some problems implimenting the jquery for me I get this error on the console Uncaught TypeError: Object [object Object] has no method 'miniColors' I have included all jquery files needed. <script src="javascripts/jquery.minicolors.js"></script> <link rel="stylesheet" href="stylesheets/jquery.minicolors.css" /> <input class="mini" type="minicolors" data-swatch-position="left" value

Can jQuery be used to select a div based on its height? Or is the tutorial wrong?

微笑、不失礼 提交于 2019-12-12 13:24:29
问题 I am trying to select a div based on its height, as shown in this tutorial, jQuery Selection. I cannot get it to work: jsbin example . The line not working is: $('div[height=50px]').css('background-color', 'orange'); 回答1: That's an attribute equals selector, so the HTML it would match is: <div height="50px"></div> You could change it to: $('div[style="height:50px"]').css('background-color', 'orange'); According to comments, the above doesn't work in Internet Explorer. Try the following