Search Results

Search found 753 results on 31 pages for 'selectors'.

Page 5/31 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to I add a JQuery locators to Selenium Remote Control

    - by danswain
    Hi, I've been using XPath with Selenium quite happily and even using getEval with a but of Javascript, but a colleague said wouldn't it be great to be able to use JQuery selectors in Selenium. I've googled it, but can't find any articles that seem to work for me. Could anyone provide a comprehensive guide on how to use JQuery syntax to extract doc elements and their respective values out of selenium. I'm using C# to write my selenium tests, so if any examples could be from a C# perspective that'd be great. Thanks

    Read the article

  • Answered: Selecting even table rows from a table element

    - by mvrak
    The issue I am having is: How do I go from a variable pointing at an element to using CSS selectors? I want to make this work: function highlight(table) {$(table " > :even").toggleClass('highlight');} where table is a reference to a table element. I don't want answers that tell me to use $('#table') because that defeats the point of the generality I am trying to make. Thanks

    Read the article

  • jQuery prevUntil() include start selector and end selecter

    - by Globalz
    I would like to select the start and end selector for the prevUntil() or nextUntil() jQuery selector methods. If i implement these methods now, it grabs everything between the two selectors given. i.e. $('p').prevUntil('h1') will not include the p and h1 element, only those between them. How could I also select the p and h1 elements as well as though between? Thanks!

    Read the article

  • Are Objective-C function names stored in text?

    - by thyrgle
    I don't remember where I heard about it, (I think I was searching up on how selectors worked and it ended up not being exactly the same as a callback function) and I can't confirm it. But more importantly than that, is there a way I could get a list of the function names from another application?

    Read the article

  • how to parse jquery ajax xhtml response?

    - by steve
    Sorry if this has been posted many times. But I've tried many variations and it still doesn't work. The HTML comes back from the jquery AJAX call fine and I am trying to remove the header and footers from the response using: // none of these work for me $("#content", data); $("#content", $(data)); $(data).find("#content").html() I've breakpoint the response to verify the #content exists by inspected $(data) and using alert to print out the data's text. I've also try using "body" or "a" as selectors, but it always come back as undefined. I've read in this post that you can't pull in the full XHTML document: http://stackoverflow.com/questions/1050333/jquery-ajax-parse-response-text. But I can't find the answer's quote anymore, maybe it's outdated? Has anyone ran into this problem? Many thanks, Steve

    Read the article

  • CSS Selector not working on elements within a div

    - by stevebot
    Hi, I have the following HTML structure: <div class="formFields"> <label> Field 1: </label> <input type="text" value="" name="field1" /> </div> And my CSS selectors are as follows: #formFields {clear:both;} #formFields label {font-weight:bold;} The clear:both; is being applied to the div, but the font-weight:bold; is not being applied to the labels. How would I apply this font-weight to the labels?

    Read the article

  • Passing methods/functions as args in Objective C

    - by Baishampayan Ghose
    Hello, I am new to Objective C and I am trying to implement an async library which works with callbacks. I need to figure out a way to pass callback methods as args to my async methods so that the callback can be invoked when the task is finished. What is the best way to achieve this in Objective C? In Python, for example I could easily pass a function, but in Objective C it seems selectors are the way to go(?). Can anyone point me to an example from where I can get some ideas? Thanks in advance.

    Read the article

  • Find HTML based on partial attribute

    - by Kirean
    Is there a way with javascript (particularly jQuery) to find an element based on a partial attribute name? I am not looking for any of the selectors that find partial attribute values as referenced in these links: starts with [name^="value"] contains prefix [name|="value"] contains [name*="value"] contains word [name~="value"] ends with [name$="value"] equals [name="value"] not equal [name!="value"] starts with [name^="value"] but more something along the lines of <div data-api-src="some value"></div> <div data-api-myattr="foobar"></div> and $("[^data-api]").doSomething() to find any element that has an attribute that starts with "data-api".

    Read the article

  • Multiple classes in body tag, multi-dimensional css structure or blueprint for insanity?

    - by mwiik
    This question is about an approach to css structuring, and so is more discussion oriented. I'm working with some outsourced css where the body tags have multiple classes assigned, up to half a dozen. (To make things a little worse, none of the css selectors include an html tag which is making it confusing to analyze the css.) These body classes are then used to modify classed or id'd widgets within. It seems like this approach is like adding an additional dimension to the css, perhaps in some attempt to create a structured css approach. Documentation might have helped, had we been provided any. This differs from my approach where widgets are styled primarily via id'd divs, perhaps extracting the more generic elements into a class, i.e. div#MyWidget.widgets. Any ideas on whether such an approach is maintainable, especially considering I am dealing with websites with thousands of pages including tons of legacy stuff, all done by different people with different skill levels? Thanks...

    Read the article

  • difference between :first and :first-child not clear

    - by sushil bharwani
    i am having a ul li list <ul> <li>Parent <ul> <li> child1 </li> <li> child2 </li> </ul> </li> </ul> and i am trying to use a selector jQuery('ul li:first') and jQuery('ul li:first-child') both giving the same result this makes me confused about the difference between the two is there a example which clarifies the difference between two selectors

    Read the article

  • difference be :first and :first-child not clear

    - by sushil bharwani
    i am having a ul li list < ul > < li > Parent < ul > < li > child1 < /li > < li > child2 < /li > < /ul > < /li > < /ul > and i am trying to use a selector jQuery('ul li:first') and jQuery('ul li:first-child') both giving the same result this makes me confused about the difference between the two is there a example which clarifies the difference between two selectors

    Read the article

  • jQuery text attribute selector

    - by Shagglez
    I am trying to use the text attribute as a selector, but I can't quite grasp the behaviour, would really appreciate if someone could explain. For example given <span class="span_class"><a class="a_class">text</a></span>, $('a.a_class').text() gives "text" as expected. However $('a.a_class[text]') wouldn't match any elements, and neither would $('span.span_class > a.a_class[text]'), but $('span.span_class* > a.a_class[text]') would (although not in IE). The only workaround I can think of for IE, is loop through all anchors contained in a span, use .text() on each and match it against a certain criteria, but it seems slower than using in-built selectors. Anyone have better ideas?

    Read the article

  • Is a selector like *+* safe to use?

    - by mcmullins
    I recently came across this CSS selector while trying to find a way to easily space out major blog elements such as paragraphs and images. An example of its use would be something like this: .post *+* {margin-top: 15px;} /* or... */ .post > *+* {margin-top: 15px;} /* if you don't want the margin to apply to nested elements */ At first glance, it seemed pretty useful. So my question is: What downsides are there to using these selectors? Specifically: What's the browser support like for this? Are there any cases you wouldn't want an even margin spacing between elements in an article and if not, is it easier to declare this first and then overwrite or simply declare each element individually? Does this have performance issues since you're selecting everything twice?

    Read the article

  • CSS background-images and Z-Index problem

    - by dscher
    Hope someone has an easy answer on this. I have a header image which is just a 75px high gradient with a fade on the bottom. I have it set as the background image on my header and I want to throw in a left-sidebar on my page. There is a transparency on the header image and when I have my sidebar I can't get it to sit behind the header. You can see in this screenshot: link text The green sidebar won't "sit" behind the header. I have the header z-index set to 99 and the sidebar to 1. I tried the reverse to make sure I didn't mix up my numbers but that didn't work. Both are absolutely positioned. I'm attaching their CSS selectors in the hopes someone has an easy answer. Am sure I'm missing something basic: div.header { z-index: 99; background: transparent; background-image: url(images/header_bg.png); position: absolute; height: 85px; width: 100%; font-family: Helvetica, Verdana, Arial, sans-serif; } div#leftsidebar { height: 400px; border-right-style: dashed; border-right-width: 1px; z-index: -1; margin-top: 75px; width: 200px; position: absolute; background-color: #66ff66; } Thanks.

    Read the article

  • jQuery selector issue finding image with usemap attribute

    - by Greg K
    I have an image map in my page: <div id="books"> <img src="images/books.png" width="330" height="298" border="0" \ usemap="#map_books" /> <map name="map_books" id="map_books" alt="books"> <area shape="poly" coords="17,73,81,288,210,248,254,264, ..." \ href="/about" alt="books" /> </map> </div> I have a function that tries to find the image in the document using this map: function(elemId) { // elemId = "#map_books" if ($(elemId).attr("tagName") == "MAP") { // find image using this map var selector = "img [usemap=\\" + elemId + "]"; var img = $(selector); if (img.length == 0) { console.log("Could not find image using " + selector); } } It fails to find the image. Could not find image using img [usemap=\#map_books] I've escaped the elemId because it starts with a hash and tried variations of selectors. $("img [usemap$=" + elemId.substring(1) + "]") $("img").find("[usemap=\\" + elemId + "]") Neither find the image. Any ideas?

    Read the article

  • Adding multiple star rating widgets to one page

    - by diglettpotato
    I am using this jQuery plugin for star ratings: http://orkans-tmp.22web.net/star_rating/ Everything is going great, including using AJAX, etc. The problem is that I need to have many per page and can't quite figure out how to work with the selectors to achieve this. I think this is probably very easy for someone who knows their jQuery... Here's some code below... There are multiple kids per page, and I need one rating widget for each kid. I can set up each #rat to be unique with a kid attached to it, like #1rat, #2rat, etc. But then how would I set up the function to be run on each of them independently? <script type="text/javascript"> $(function(){ var kidval=1; //this needs to be setup for each kid... not just 1 var uidval=1; $('#rat').children().not("select, #rating_title").hide(); var $caption = $('<div id="caption"/>'); $('#rat').stars({ inputType: "select", oneVoteOnly: false, callback: function(ui, type, value) { $("#"+kidval+"messages").text("Saving...").fadeIn(30); $.post("vote.php", {rate: value, kid: kidval, uid: uidval}, function(json) { $("#"+kidval+"messages").text("Average"); ui.select(Math.round(json.avg)); $caption.text(" (" + json.votes + " votes, " + json.avg + " avg)"); $("#"+kidval+"messages").text("Rated " + value + " Thanks!").stop().css("opacity", 1).fadeIn(30); setTimeout(function(){ $("#"+kidval+"messages").fadeOut(1000) }, 2000); }, "json"); } }); $('#rat').stars("selectID", -1); $caption.appendTo(#rat); $('<div id="'+kidval+'messages"/>').appendTo(#rat); });

    Read the article

  • Preserving order when copying elements using Deliverance / XPath

    - by Jon Hadley
    How would I, using Deliverance & XPath (or CSS) selectors, select and copy list items .one and .three from each list below, but display them in the order of their parent list? <ul id="a-wrapper"> <li class="one"></li> <li class="two"></li> <li class="three"></li> <li class="four"></li> </li> <ul id="b-wrapper"> <li class="one"></li> <li class="two"></li> <li class="three"></li> <li class="four"></li> </ul> c,d,e,f,g etc.... The catch is it needs to use a href rule, eg: <prepend href="/blah/deblah" content="#x" theme="#y" /> Using the following just lists all the .one elements, then all the .three elements. <prepend href="/blah/deblah" content=".one" theme="#y" /> <prepend href="/blah/deblah" content=".three" theme="#y" />

    Read the article

  • using jquery selector to change attribute in variable returned from ajax request

    - by Blake
    I'm trying to pull in a filename.txt (contains html) using ajax and change the src path in the data variable before I load it into the target div. If I first load it into the div the browser first requests the broken image and I don't want this so I would like to do my processing before I load anything onto the page. I can pull the src values fine but I can't change them. In this example the src values aren't changed. Is there a way to do this with selectors or can they only modify DOM elements? Otherwise I may have to do some regex replace but using a selector will be more convenient if possible. $.ajax( { url: getDate+'/'+name+'.txt', success: function(data) { $('img', data).attr('src', 'new_test_src'); $('#'+target).fadeOut('slow', function(){ $('#'+target).html(data); $('#'+target).fadeIn('slow'); }); } }); My reason is I'm building a fully standalone javascript template system for a newsletter and since images and other things are upload via a drupal web file manager I want the content creators to keep their paths very short and simple and I can then modify them before I load in the content. This will also be distributed on a CD so I can need to change the paths for that so they still work.

    Read the article

  • jquery find() - how to exclude certain descendants, and their children?

    - by jammypeach
    I have markup similar to this: <div class='wrapper plugin'> //some content <div class='child-wrapper plugin'> //some more content <div> <ul> <li><div class='cliky'>clicky!</div></li> </ul> </div> </div> <div class='cliky'>clicky!</div> </div> I need to be able to select the first .clicky div only, not any .clicky divs inside a .plugin > .plugin div. The wrapper has .plugin class too - might seem counter-intuitive so another way to view it is this: I want to get the .clicky children of a given .plugin div, but not .plugin .plugin .clicky. Here's the problem - the depth of each .clicky element (or indeed, the number of them) is unknown and variable in relation to the wrappers. One could be immediately below the first wrapper, or inside 10 <ul>s. I've tried selectors like: $('.wrapper').find('.clicky').not('.plugin > .clicky'); But they still selected child .clicky. How would I be able to filter out .plugin and any children of .plugin from my selector before using find()?

    Read the article

  • Div's are not filtered as :hidden when display:none; is appended as style

    - by CodeMonkey
    Hey folks I have some simple HTML: <div id="selectorContainer"> <div id="chainedSelector" style="display: none;"><% Html.RenderPartial("ProjectSuggest/ChainedProjectSelector"); %></div> <div id="suggestSelector"><% Html.RenderPartial("ProjectSuggest/SuggestControl", new SuggestModeDTO{RegistrationMode = Model.RegistrationMode}); %></div> </div> which is two containers for controls. I have jQuery code to toggle between displaying these, but I need to store as a cookie which one was used last time the user was logged in (i.e. which one was visible). The storing of the cookie is not the problem. The problem is that I for some reason am not able to detect which one is the hidden one, using .is(":hidden"), and not able to detect which one is visible using .is(":visible") When I use those two selectors, I always get both. "true" and "true" for both, eventhough one has display: none; and the other doesn't. Please note that they are NOT placed inside a hidden container which otherwise would hide both, so there are not any hidden ancestor containers. Can anyone maybe explain why this could happen? jQuery code containing source for getting the Id's and for getting the selected one (which currently is broken): getChainedSelectorId: function() { return "#chainedSelector"; }, getSuggestSelectorId: function() { return "#suggestSelector"; }, getSelectedSelector: function() { alert($(this.getChainedSelectorId()).is(":hidden")); alert($(this.getSuggestSelectorId()).is(":hidden")); var selected = ($(this.getChainedSelectorId()).is(":visible") ? this.getChainedSelectorId() : this.getSuggestSelectorId()); alert(selected); return selected; }, Thanks in advance.

    Read the article

  • How * tag can be used in CSS?

    - by php html
    I'm trying to understand how a background image is used in a css button. It seems the image is much larger than the button, still the corners are matched to the button(resulting a rounded corner button). It seems it is related to .btn *. I couldn't find any reference about how * can be used. Can you explain how the image is rendered in the button, using the * tag? I assume * will match any element. However I don't get it how in this case the image is rendered like this. .btn { display: block; position: relative; background: #aaa; padding: 5px; float: left; color: #fff; text-decoration: none; cursor: pointer; } .btn * { font-style: normal; background-image: url(btn2.png); background-repeat: no-repeat; display: block; position: relative; } full example here: http://monc.se/kitchen/59/scalable-css-buttons-using-png-and-background-colors/

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >