Search Results

Search found 3 results on 1 pages for 'luckyshot'.

Page 1/1 | 1 

  • CSS Attribute selector - Match attribute values that begin with

    - by LuckyShot
    I am trying to identify all the <UL> that contain a menu list by defining the ID like this: <ul id="menutop"> <li><a href="#">item1</a></li> <li><a href="#">item2</a></li> <li><a href="#">item3</a></li> </ul> <ul id="menumain"> <li><a href="#">item1</a></li> <li><a href="#">item2</a></li> <li><a href="#">item3</a></li> </ul> As per what I understand, I could use: ul[id|='menu']>li>a {color:#f00;} (<a> direct child of a <li> direct child of an <ul> that has its id starting with menu) But it doesn't work. Searching a bit brought me this [question][1] which suggests that ID is an attribute and not a property so I don't get why it isn't working. What am I doing wrong? Here's a link to the CSS2 Matching attributes and attribute values as per the W3 standards ( http://www.w3.org/TR/CSS2/selector.html#matching-attrs ).

    Read the article

  • jQuery - Add click event to Div and go to first link found

    - by LuckyShot
    Hi guys, I think I've been too much time looking at this function and just got stuck trying to figure out the nice clean way to do it. It's a jQuery function that adds a click event to any div with a click CSS class found in the page and when clicked it redirects the user to the first link found in the div. function clickabledivs() { $('.click').each( function (intIndex) { $(this).bind("click", function(){ window.location = $( "#"+$(this).attr('id')+" a:first-child" ).attr('href'); }); } ); } The code simply works although I'm pretty sure there is a fairly better way to accomplish it, specially the selector I am using: $( "#"+$(this).attr('id')+" a:first-child" ) looks too long and slow. Any ideas? Please let me know if you need more details. Thanks! PS: I've got some jQuery benchmarking reference from Project2k.de here: http://blog.projekt2k.de/2010/01/benchmarking-jquery-1-4/

    Read the article

  • Accessing XML/PHP with period in tag

    - by LuckyShot
    Hi guys, Quick newbie question here, how do I access totalResults? XML <?xml version="1.0" encoding="UTF-8"?> <OpenSearchDescription> <opensearch:totalResults>1</opensearch:totalResults> <posts> <post> <score>10</score> </post> </posts> </OpenSearchDescription> To access the score I would do this: PHP $xmlObj = simplexml_load_string($theXMLabove); echo $xmlObj->posts->post[0]->score; But none of these work for the totalResults: echo $xmlObj->opensearch:totalResults; echo $xmlObj->opensearch->totalResults; Sorry for asking such a lame question... Documentation on how to traverse XML with PHP is also appreciated :) Thanks!

    Read the article

1