siblings

CSS - Sibling selector not working in android?

陌路散爱 提交于 2019-12-01 05:27:00
This code works fine in Chrome on desktop, but not android stock browser: <!DOCTYPE html> <html> <head> <style type="text/css"> input:checked ~ span {color:red;} </style> </head> <body> <label> <input type="checkbox" /> <span>First item</span> </label> </body> </html> Basically when you click hte check mark, the span tag text should turn red. It's not turning red on my Galaxy Note with android 4.0. What's wrong with my code? http://quirksmode.org/css/selectors/mobile.html The sibling selector is supported the :checked pseudo-class is not 来源: https://stackoverflow.com/questions/15192674/css

CSS - Sibling selector not working in android?

丶灬走出姿态 提交于 2019-12-01 03:48:30
问题 This code works fine in Chrome on desktop, but not android stock browser: <!DOCTYPE html> <html> <head> <style type="text/css"> input:checked ~ span {color:red;} </style> </head> <body> <label> <input type="checkbox" /> <span>First item</span> </label> </body> </html> Basically when you click hte check mark, the span tag text should turn red. It's not turning red on my Galaxy Note with android 4.0. What's wrong with my code? 回答1: http://quirksmode.org/css/selectors/mobile.html The sibling

Cross-domain JavaScript code with sibling sub-domains

放肆的年华 提交于 2019-11-30 21:00:28
I have two web applications setups: david .example.com and john .example.com David opens a new window to John: window.open('john.example.com'); John would now like to set an input element back on David: $("#input", window.opener.document).val("Hello David."); My problem is that this doesn't work on most modern browser because of cross-domain scripting security. I've also tried setting document.domain to different domain combinations both on David and John with no success. The only time this does work is if John is on example.com and both have document.domain set to example.com . However,

XSLT merging/concatenating values of siblings nodes of same name into single node

房东的猫 提交于 2019-11-30 07:31:47
Input xml <catalog> <product id="1"> <name>abc</name> <category>aaa</category> <category>bbb</category> <category>ccc</category> </product> <product id="2"> <name>cde</name> <category>aaa</category> <category>bbb</category> </product> </catalog> Expected Output xml <products> <product> <id>1</id> <name>abc</name> <category>aaa,bbb,ccc</category> </product> <product> <id>2</id> <name>cde</name> <category>aaa,bbb</category> </product> </products> XSLT for transformation <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes"/> <xsl

Cross-domain JavaScript code with sibling sub-domains

左心房为你撑大大i 提交于 2019-11-30 05:27:15
问题 I have two web applications setups: david .example.com and john .example.com David opens a new window to John: window.open('john.example.com'); John would now like to set an input element back on David: $("#input", window.opener.document).val("Hello David."); My problem is that this doesn't work on most modern browser because of cross-domain scripting security. I've also tried setting document.domain to different domain combinations both on David and John with no success. The only time this

Find value of sibling key in php array

泄露秘密 提交于 2019-11-29 13:11:17
I have an array in PHP, here is a snippet: Array ( [0] => Array ( [id] => 202 [name] => GXP Club - Fable ) [1] => Array ( [id] => 204 [name] => GXP Club - Gray ) ) What I know (from a GET) is the ID (202). What I would like to display is "Showing results for " ( where $locations[?][id] = $_GET['id'] { echo $locations[?][name] } ) - if you will pardon my use of pseudo code. Not sure what function is best or if I need to loop over the whole array to find that. Thanks. Edit: for further clarification. I need to learn the [name] given the [id] foreach( $locations as $arr ) { if($arr['id'] == $_GET

Find next siblings until a certain one using beautifulsoup

喜欢而已 提交于 2019-11-29 10:05:18
The webpage is something like this: <h2>section1</h2> <p>article</p> <p>article</p> <p>article</p> <h2>section2</h2> <p>article</p> <p>article</p> <p>article</p> How can I find each section with articles within them? That is, after finding h2, find nextsiblings until the next h2. If the webpage were like: (which is normally the case) <div> <h2>section1</h2> <p>article</p> <p>article</p> <p>article</p> </div> <div> <h2>section2</h2> <p>article</p> <p>article</p> <p>article</p> </div> I can write codes like: for section in soup.findAll('div'): ... for post in section.findAll('p') But what should

Select last child when odd, 2 last childs when even

梦想的初衷 提交于 2019-11-29 09:07:24
问题 I'm in a situation where the number of elements showed is variable, and I need a strange solution which I'm not able to achieve, I even doubt if it's achievable only with css. I need to select the last-child if my number of elements is odd, and the last 2 child if the number of elements is even. I've been trying with nth-last-child , :not(:nth-last-child()) , odd and even, but never got a good solution. Anyone has any idea/advice about this issue a part of adding a class "odd" like on html

CSS adjacent sibling selectors - IE8 problem

假装没事ソ 提交于 2019-11-28 13:44:06
I am creating a menu system using a UL/LI structure. I'm trying to use sibling selectors for hover/show-sub-menus. I'm using this; #MainMenu li.Sel ul li.HasSub a:hover+ul { display: block; } The UL structure would be something like this; <ul id='MainMenu'> <li class='Sel'> <a href='#'>Click Me</a> <ul> <li class='HasSub'> <a href='#'>Hover Over Me</a> <ul> <li>Link</li> <li>Link</li> </ul> </li> </ul> </li> </ul> Supposedly, when hovering over "Hover Over Me", the sibling ul should be displayed. It works great in Firefox, but not at all in IE8. I'm sure I've seen the '+' sibling selector used

How to cycle through siblings using jQuery?

限于喜欢 提交于 2019-11-28 13:40:37
I have the folowing code: html: <div class="container"> <div class="selected">A</div> <div>B</div> <div>C</div> <div>D</div> </div> <button id="next">next!</button> jQuery: $("#next").click(function() { $(".selected").removeClass("selected").next().addClass("selected"); }); What i want is loop through the divs in the container. I can do this to cycle: $("#next").click(function() { if ($(".selected").next().length == 0) { $(".selected").removeClass("selected").siblings(":nth-child(1)").addClass("selected"); } else { $(".selected").removeClass("selected").next().addClass("selected"); } }); But i