elements

Looking to use pseudo elements to create a triangle

偶尔善良 提交于 2019-12-13 13:19:39
问题 I recently watched Chris Coyiers talk about pseudo elements and was looking to try and do the same. I am looking to get the effect of an arrow pointing to the content on the right This is the location of the li that I want to target .overviews-list > li.active > ul.submenu > li.active You can see from the jsfiddle the style I am going for. I think the css that needs to be changed is at the top of the css. http://jsfiddle.net/T2HuD/1/ 回答1: This will set the positioning and create a down

How to rearrange some elements as a data frame

大憨熊 提交于 2019-12-13 04:22:15
问题 I want to rearrange some elements as a date frame. elements as follows: code<-000586 t<-2013-12-28 price<-10.23 change<-2.56 I want use these elements form a data frame like this code t price change 000586 2013-12-28 10.23 2.56 > t1=2013-12-27 > head(mydat) dm sc date code 14 000586 sz 2013-12-27 000586.sz 15 000616 sz 2013-12-26 000616.sz 16 300295 sz 2013-12-25 300295.sz 17 000968 sz 2013-12-23 000968.sz 18 600023 sh 2013-12-19 600023.sh 20 600855 sh 2013-12-18 600855.sh >code<-mydat[1,1] >

Create elements dynamically in XSLT

血红的双手。 提交于 2019-12-13 03:12:47
问题 I want to create as many <Group> elements as they are in the Main xml dynamically using XSLT as <Group folder ="Group1"> in the new Xml. Also, the <Data> element added as the last child should be added only once inside. Main Xml <Root> <ClassA> <Groups> <Group1> <Group2> <Group3> ............ </Group3> </Group2> </Group1> </Groups> <Data> <Name>George</Name> <Class>A</Class> </Data> </ClassA> </Root> I need an Xml like this <Data> <ClassA> <Group folder = "Group1"> <Group folder = "Group2">

Javascript get element index position in DOM array by class or id

折月煮酒 提交于 2019-12-13 02:23:40
问题 My situation var domElements = document.body.getElementsByTagName('*'); Now I want to return the array item key - position of the element in the array - ( for example domElements[34] ) searching in the array for the element with id="asd" . How can I achieve this? What if instead of ID I want to search trough class="asd hey" ? Any help appreciated, thank you! NB: Not in jquery, I need it in pure javascript in this case 回答1: Try like this var matches = document.querySelectorAll("#asd"); If you

JQuery get element id from ajax loaded data

巧了我就是萌 提交于 2019-12-13 01:15:28
问题 I load data from a PHP page with JQuery and it works fine. Now I want that when I click on one of these loaded elements an alert shows the id of the selected element. How can I do? If I put an element manually into the div "output" it works, but with the element created with $.ajax() it doesn't works. Here is the code. <input type="text" id="ricerca"> <div id="output" style="border: 1px solid #FF0000;"></div> $(document).ready(function () { // Autocomplete $("#ricerca").keyup(function () { $

show alert using jQuery-Impromptu if elements value is empty or zero

混江龙づ霸主 提交于 2019-12-12 17:51:44
问题 I want to popup alert if elements values are empty or zero. I want to use Impromptu for that. here is example of Impromptu: http://jsfiddle.net/hGRtH/ and my input elements are: <select name="side_room_type" id="room_type" onchange="return getAdultRoom(this.value)" class="input-medium"><option value="0">Select Room Type</option><option value="5">Family Room</option><option value="7">Seaside Rooms</option></select> <input type="hidden" name="side_check_in_date" onchange="return getAdultRoom

Adding non-zero elements of a matrix in R

折月煮酒 提交于 2019-12-12 04:54:54
问题 I have a matrix 'w' with zero and non-zero elements. I want to print out the index of the non-zero elements in the matrix, print the values of each non-zero element and get the sum of the non-zero elements in the matrix. I know I can print the index of non-zero elements using which(w!=0, arr.ind=TRUE) I am trying to print the values of the non-zero elements in 'w' matrix but the code is returning the whole matrix instead of only the non-zero elements. for(i in 1:36){ for(j in 1:36){ if(w[i,j]

What can I get number of clicked element

不羁岁月 提交于 2019-12-12 04:32:42
问题 I have a few elements with identical class names. How can I get the number of the elements which I clicked with onclick events? For example: var x = document.getElementsByClassName("myclass").length; for (a=0; a<=x; a++) { // here i want get number of clicked myclass } 回答1: You can use indexOf on an array of document.getElementsByClassName("myclass") . You can use Array.from or [].slice.call to make the array. Assuming your click handlers look like in the snippet below and they “Do something

cakePHP layout data, using requestAction, is there another way?

陌路散爱 提交于 2019-12-12 03:39:28
问题 I'ts a known issue, requestAction is a resource waste. however, I need some dynamic data in my default layout. I'm using elements for it, with requestAction calls. Is it the only way? 回答1: There's nothing wrong with requestAction, it's just very easy to invoke it inefficiently and skewer your app's performance. The way it works, you'll end up with monster objects bulging with properties, etc - stuff you don't need and probably wouldn't have pulled if you'd realized it was going to happen like

How do I print out lines recursively from a text file along with the average value of total elements from per line?

心不动则不痛 提交于 2019-12-12 03:26:05
问题 I know this question sounds a bit challenging, but hey I find nothing like this relates with F sharp here. Okay so, since in my previous question I mentioned I'm new to F#. Thanks to several of fellow programmers' helps here to solve my sum function in my previous question. So, I have a text file that contained more than 20 lines and I want to print out lines with year and average of total elements from each year and its elements. Sample text lines 2009 1.3 3.51 6.76 5.80 4.48 5.47 2.06 4.3 0