Search Results

Search found 8975 results on 359 pages for 'element'.

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

  • Element point map for html5 canvas element, need algorithm

    - by Artiom Chilaru
    I'm currently working on a pure html 5 canvas implementation of the "flying tag cloud sphere", which many of you have undoubtedly seen as a flash object in some pages. The tags are drawn fine, and the performance is satisfactory, but there's one thing in the canvas element that's kind of breaking this idea: you can't identify the objects that you've drawn on a canvas, as it's just a simple flat "image".. What I have to do in this case is catch the click event, and try to "guess" which element was clicked. So I have to have some kind of matrix, which stores a link to a tag object for each pixel on the canvas, AND I have to update this matrix on every redraw. Now this sounds incredibly inefficient, and before I even start trying to implement this, I want to ask the community - is there some "well known" algorithm that would help me in this case? Or maybe I'm just missing something, and the answer is right behind the corner? :)

    Read the article

  • Jquery check if element exists then add class to different element

    - by Buddy
    I don't know much about jquery at all, so bear with my ignorance, but I'm pretty sure I can accomplish this with jquery. I need jquery to check if an element exists, and if so, add a class to a different element. For example, if class "minimal-price-link" exists, then add a class to "regular-price" or what I really am wanting to do is make the regular-price strikethrough. Here's the code: <div class="price-box"> <span class="regular-price" id="product-price-2"> <span class="price">$240.00</span> </span> <a href="http://stemulation.com/order/sfs30.html" class="minimal-price-link"> <span class="label">Your Price:</span> <span class="price" id="product-minimal-price-2">$110.00</span> </a> </div>

    Read the article

  • xpath nearest element to a given element

    - by nologo
    hi, having trouble returning an element using xpath.. i need to get the text from the 2nd TD.. <tr> <td> <label for="PropertyA">Some text here </label> </td> <td> TEXT!! </td> </tr> i'm able to find the label element but then im having trouble selecting the td following to return the text. this is how i select the label: "//label[@for='PropertyA']" thanks

    Read the article

  • Windows Phone 7 Control Caching - 'Element is already the child of another element'

    - by will
    I'm trying to speed up my windows phone 7 page load times. I have a 'static' page that has a dynamically created in a Panorama control - static meaning that the content never changes. On the first load I look at my config file, create the individual PanoramaItem controls and add them to the main Panorama control. I'm trying to keep a List in a static place so that the initial creation would only happen once and I could just add a fully rendered version to my Panorama control when the page was rendered. Works fine on first load, but when I try to add the cached PanoramaItems to the Panorama control I get the message "Element is already the child of another element". This makes sense since I already added before. But I can see a way to disconnect the PanoramaItems with the first Panorama control... I could be going about the control caching thing all wrong as well... Let me know if there's another way to do this.

    Read the article

  • How to get the second sub element of every element in a list in R

    - by PaulHurleyuk
    I know I've come across this problem before, but I'm having a bit of a mental block at the moment. and as I can't find it on SO, I'll post it here so I can find it next time. I have a dataframe that contains a field representing an ID label. This label has two parts, an alpha prefix and a numeric suffix. I want to split it apart and create two new fields with these values in. structure(list(lab = c("N00", "N01", "N02", "B00", "B01", "B02", "Z21", "BA01", "NA03")), .Names = "lab", row.names = c(NA, -9L ), class = "data.frame") df$pre<-strsplit(df$lab, "[0-9]+") df$suf<-strsplit(df$lab, "[A-Z]+") Which gives lab pre suf 1 N00 N , 00 2 N01 N , 01 3 N02 N , 02 4 B00 B , 00 5 B01 B , 01 6 B02 B , 02 7 Z21 Z , 21 8 BA01 BA , 01 9 NA03 NA , 03 So, the first strsplit works fine, but the second gives a list, each having two elements, an empty string and the result I want, and stuffs them both into the dataframe column. How can I select the second sub-element from each element of the list ? (or, is there a better way to do this) Thanks Paul.

    Read the article

  • Prevent event from parent element to child element in jquery

    - by sonam
    I have binded event as below: $(document).delegate('.budget', 'click', function(e){ if ($(this).hasClass('collapsed')) { $(this).removeClass('collapsed'); $(this).addClass('expanded'); } else if ($(this).hasClass('expanded')) { $(this).removeClass('expanded'); $(this).addClass('collapsed'); } }); Basically this toggles between expand and collapse. I have another event binded as below: $('[id^="tree"]').delegate('.collapsed', 'click', function(e){ var elementId = $(this).attr('id'); hideChildElement(elementId); }); The elements binded by the second event binding are parents of elements binded by first event binding. What happens is that on clicking on the element from the first binding event method also triggers the event binded by second event binding. I want to prevent any events from binding from second event binding to 1st event binding method. If element A is binded to click event from first event binding and B is binded to second event binding (A is inside B or A is child of B), I dont want any event of B to propagate to A. Note I tried e.stopImmediatePropagation(); but did not worked

    Read the article

  • Monitoring Html Element CSS Changes in JavaScript

    - by Rick Strahl
    [ updated Feb 15, 2011: Added event unbinding to avoid unintended recursion ] Here's a scenario I've run into on a few occasions: I need to be able to monitor certain CSS properties on an HTML element and know when that CSS element changes. For example, I have a some HTML element behavior plugins like a drop shadow that attaches to any HTML element, but I then need to be able to automatically keep the shadow in sync with the window if the  element dragged around the window or moved via code. Unfortunately there's no move event for HTML elements so you can't tell when it's location changes. So I've been looking around for some way to keep track of the element and a specific CSS property, but no luck. I suspect there's nothing native to do this so the only way I could think of is to use a timer and poll rather frequently for the property. I ended up with a generic jQuery plugin that looks like this: (function($){ $.fn.watch = function (props, func, interval, id) { /// <summary> /// Allows you to monitor changes in a specific /// CSS property of an element by polling the value. /// when the value changes a function is called. /// The function called is called in the context /// of the selected element (ie. this) /// </summary> /// <param name="prop" type="String">CSS Properties to watch sep. by commas</param> /// <param name="func" type="Function"> /// Function called when the value has changed. /// </param> /// <param name="interval" type="Number"> /// Optional interval for browsers that don't support DOMAttrModified or propertychange events. /// Determines the interval used for setInterval calls. /// </param> /// <param name="id" type="String">A unique ID that identifies this watch instance on this element</param> /// <returns type="jQuery" /> if (!interval) interval = 200; if (!id) id = "_watcher"; return this.each(function () { var _t = this; var el$ = $(this); var fnc = function () { __watcher.call(_t, id) }; var itId = null; var data = { id: id, props: props.split(","), func: func, vals: [props.split(",").length], fnc: fnc, origProps: props, interval: interval }; $.each(data.props, function (i) { data.vals[i] = el$.css(data.props[i]); }); el$.data(id, data); hookChange(el$, id, data.fnc); }); function hookChange(el$, id, fnc) { el$.each(function () { var el = $(this); if (typeof (el.get(0).onpropertychange) == "object") el.bind("propertychange." + id, fnc); else if ($.browser.mozilla) el.bind("DOMAttrModified." + id, fnc); else itId = setInterval(fnc, interval); }); } function __watcher(id) { var el$ = $(this); var w = el$.data(id); if (!w) return; var _t = this; if (!w.func) return; // must unbind or else unwanted recursion may occur el$.unwatch(id); var changed = false; var i = 0; for (i; i < w.props.length; i++) { var newVal = el$.css(w.props[i]); if (w.vals[i] != newVal) { w.vals[i] = newVal; changed = true; break; } } if (changed) w.func.call(_t, w, i); // rebind event hookChange(el$, id, w.fnc); } } $.fn.unwatch = function (id) { this.each(function () { var el = $(this); var fnc = el.data(id).fnc; try { if (typeof (this.onpropertychange) == "object") el.unbind("propertychange." + id, fnc); else if ($.browser.mozilla) el.unbind("DOMAttrModified." + id, fnc); else clearInterval(id); } // ignore if element was already unbound catch (e) { } }); return this; } })(jQuery); With this I can now monitor movement by monitoring say the top CSS property of the element. The following code creates a box and uses the draggable (jquery.ui) plugin and a couple of custom plugins that center and create a shadow. Here's how I can set this up with the watcher: $("#box") .draggable() .centerInClient() .shadow() .watch("top", function() { $(this).shadow(); },70,"_shadow"); ... $("#box") .unwatch("_shadow") .shadow("remove"); This code basically sets up the window to be draggable and initially centered and then a shadow is added. The .watch() call then assigns a CSS property to monitor (top in this case) and a function to call in response. The component now sets up a setInterval call and keeps on pinging this property every time. When the top value changes the supplied function is called. While this works and I can now drag my window around with the shadow following suit it's not perfect by a long shot. The shadow move is delayed and so drags behind the window, but using a higher timer value is not appropriate either as the UI starts getting jumpy if the timer's set with too small of an increment. This sort of monitor can be useful for other things as well where operations are maybe not quite as time critical as a UI operation taking place. Can anybody see a better a better way of capturing movement of an element on the page?© Rick Strahl, West Wind Technologies, 2005-2011Posted in ASP.NET  JavaScript  jQuery  

    Read the article

  • Chrome trims the last <li> element in a row [closed]

    - by Paul
    Ok guys, I give up. Here's the code I'm struggling with: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <title>Blah</title> <style type="text/css"> #container { margin: 0 auto; width: 350px; border: 1px solid #ccc; } ul { list-style-type: none; margin: 0; padding: 0; text-align: center; } ul li { display: inline; padding: 5px; margin: 0 1px; background-color: lime; line-height: 2em; /* border: 1px solid red; */ } </style> </head> <body> <div id="container"> <ul> <li>Element A</li> <li>Element B</li> <li>Element C</li> <li>Element D</li> <li>Element E</li> <li>Element F</li> </ul> </div> </body> </html> Why the heck does Chrome trim the right side of "Element D" (even though there is enough space to display whole item), while Firefox and even Internet Explorer render this code properly? It becomes more visible when we apply the commented border. In other words, is there a way to tell the browser that I want every single <li> element to be autonomic, and thus to move it to the next row if it doesn't fit entirely in the previous one? Can't wait to see the solution, thanks in advance.

    Read the article

  • XmlSchema.read throws exception when an element is declared nillable

    - by G33kKahuna
    I have a simple schema that I am trying to read using XmlSchema.Read() method. I keep getting The 'nillable' attribute is not supported in this context Here is a simple code in C# XmlSchema schema = null; using (StreamReader reader = new StreamReader(<Path to Schema file name>) { schema = XmlSchema.Read(reader.BaseStream, null); } Below is the schema <xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://xyz.com.schema.bc.mySchema" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xyz.com.schema.bc.mySchema" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="data"> <xs:complexType> <xs:sequence> <xs:element name="Component"> <xs:complexType> <xs:sequence> <xs:element minOccurs="1" maxOccurs="unbounded" name="row"> <xs:complexType> <xs:sequence> <xs:element name="changed_by" type="xs:string" nillable="true" /> <xs:element name="column_name" type="xs:string" nillable="true" /> <xs:element name="comment_text" type="xs:string" nillable="true" /> <xs:element name="is_approved" type="xs:string" nillable="true" /> <xs:element name="log_at" type="xs:dateTime" nillable="true" /> <xs:element name="new_val" type="xs:string" nillable="true" /> <xs:element name="old_val" type="xs:string" nillable="true" /> <xs:element name="person_id" type="xs:string" nillable="true" /> <xs:element name="poh_id" type="xs:string" nillable="true" /> <xs:element name="pol_id" type="xs:string" nillable="true" /> <xs:element name="search_name" type="xs:string" nillable="true" /> <xs:element name="unique_id" type="xs:integer" nillable="true" /> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:complexType> </xs:element> </xs:schema>

    Read the article

  • XPath to find element based on another XPath element

    - by martymcfly
    Hi, I have an Java AST and I try to find a variable inside it via XPath. Lets say the variable is called 'foobar' I could use //VariableDeclarator/VariableDeclaratorId[@Image='foobar'] but what if I dont know the text 'foobar', but want to read it from another element //VariableDeclarator/VariableDeclaratorId[@Image=//SynchronizedStatement/Expression/PrimaryExpression/PrimaryPrefix/Name] the 'Name' node has the information 'foobar' in @Image, but PrimaryPrefix/Name[@Image] does not work. How must I rewrite the condition //SynchronizedStatement/Expression/PrimaryExpression/PrimaryPrefix/Name that it is the same as @Image='foobar' ? Thanks

    Read the article

  • jquery Checking to see if element has element

    - by Mark
    I'm using jquery 1.3 and is trying to duplicate the 1.4 .has functionality. I need to check if the .page element contains the image, and if it doesn't, append it. Is it something like: var imageid = thirdimage; if ($('#page:has(#'+imageid+')') === undefined) { $('#page').append($('#'+imageid)); } Thanks.

    Read the article

  • Javascript incapable of getting element's max-height via element.style.maxHeight

    - by Zane
    I am making a simple accordion menu in javascript. I'd like to be able to set the compact and expanded heights for the elements via the css max-height and min-height values. For some reason, when I try to retrieve the min-height and max-height of the elements in javascript for animation purposes, I get an empty string rather than, for instance, "500px" like it should. The max-height value is set in css, e.g. #id { min-height: 40px; max-height: 500px; } is all set up, but when I put a debugging mechanism in my javascript such as alert( item.style.minHeight ); it pops up an empty alert box. This happens in Firefox 3.6.2 and IE 8. Does anybody know why javascript refuses to be able to get an element's minHeight and maxHeight?

    Read the article

  • InvalidOperationException sequence contains more than one element even when only one element

    - by user310256
    I have three tables, tblCompany table, tblParts table and a link table between them tblLinkCompanyParts. Since tblLinkCompanyParts is a link table so the columns that it has are LinkCompanyPartID(primary key), CompanyID from tblCompany table and PartID from tblParts as foreign keys. I have tied them up in the dbml file. In code if I write LinkCompanyParts.Parts (where LinkCompanyParts is an object of the tblLinkCompanyParts type) to get to the corresponding Part object I get the "InvalidOperationException: Sequence constains more than one element". I have looked at the data in the database and there is only one Parts record associated with the LinkCompanyPartID. The stack trace reads like at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source) at System.Data.Linq.EntityRef`1.get_Entity() at ... I read about SingleOrDefault vs FirstOrDefault but since the link table should have a one-one mapping therefore I think SingleOrDefault should work and besides "SingleOrDefault" statement is being generated behind the scenes in the designer.cs file at the following line return this._Part.Entity; Any ideas?

    Read the article

  • jQuery How do I move an element inside of another element

    - by TripWired
    Hi I'm using grails navigation plugin and when it generates menus it put the sub navigation underneath the main menu, but i'm making my menu a vertical menu so i don't want the sub menu under the whole menu i want it under the active element. Example: this is how it generate the menu and sub menu <ul class="mainmenu"> <li>item1</li> <li>item2</li> <li>item3</li> </ul> <ul class="submenu"> <li>item1</li> <li>item2</li> <li>item3</li> </ul> What i want is: <ul class="mainmenu"> <li>item1 <ul class="submenu"> <li>item1</li> <li>item2</li> <li>item3</li> </ul> </li> <li>item2</li> <li>item3</li> </ul> Since i don't know of a way to make grails nav plugin do this i guess i'll have to make jquery do it after it's generated. Any ideas?

    Read the article

  • Finding occurrences of element before and after the element in Array

    - by user3718040
    I am writing a algorithm, if an array contain 3 does not contain between two 1s. like this int array={5, 2, 10, 3, 15, 1, 2, 2} the above array contain 3, before 3 there is no 1 and after 3 is one 1 it should return True. int array={3,2,18,1,0,3,-11,1,3} in this array after first element of 3 there is two 1 it should return False. I have try following code public class Third { public static void main(String[] args){ int[] array = {1,2,4,3, 1}; for(int i=0;i<array.length;i++) { if(array[i]==3) { for(int j=0;j<array[i];j++) { if(array[j]==1) { System.out.println("I foud One before "+array[j]); }else { break; } System.out.println("yes i found the array:"+array[i]); } for(int z=0;z>array[i];z++) { if(array[z]==1) { System.out.println("I found after 3 is :"+array[z]); } break; } } } } } I am not getting exact result from my above code which i want.

    Read the article

  • Absolutely positioned element moved by margin of another element

    - by user1505528
    Here is my jsFiddle for the following question: http://jsfiddle.net/arelia/Rruxf/ I'd like to have a header that stays at the very top of the body and a footer that stays at the very bottom of the body. I have a content div (position: relative) between the header and footer, and when I set a margin around the div my absolutely positioned header and footer move from their top/bottom positions by the height of that margin (this also happened when I tried setting a margin above and below the paragraphs in the div). In the fiddle you can see that the footer is not attached to the bottom even though it's absolutely positioned (I went ahead and made the header static since static gives the intended result). How do I position the header and footer to the top and bottom of the body and not have the content in the middle move those two elements? If the position: absolute elements are moved out of the flow why would anything affect their position at all? I've tried searching here and Google for "CSS margin affects absolute" and a few other phrases to no avail. I discovered this while playing around with it some more in developer tools: Metrics show the body is the height of the html element minus the amount of one margin (the margin that's still affecting the footer). So, the body must be stretching to the height of the content div since there is nothing else within the document flow within the body to define its height. But that height ends where the content ends instead of after the margin. Shouldn't it include the margin? If I make the height of the body 100%, the footer positions itself to the bottom of the viewport and then stays fixed in that spot when I scroll. Why isn't it attaching itself to the bottom of the body instead of the bottom of the viewport?

    Read the article

  • HTML + javascript mouse over, mouseout, onclick not working in firefox.

    - by help_inmssql
    Hello Everyone, My question is to get onMouseover,onMouseout,onMousedown,onClick on a table row. For which i am calling javascript userdefined functions. onMouseover --- Background color should change. onMouseout --- Reset to original color onClick --- First column checkbox/radio button should be set and background color should change onMousedown --- background color should change. My code in html is:- <tr onMouseOver="hover(this)" onMouseOut="hover_out(this)" onMouseDown="get_first_state(this)" onClick="checkit(this)" > and the methods in javascripts are:- var first_state = false; var oldcol = '#ffffff'; var oldcol_cellarray = new Array(); function hover(element) { if (! element) element = this; while (element.tagName != 'TR') { element = element.parentNode; } if (element.style.fontWeight != 'bold') { for (var i = 0; i<element.cells.length; i++) { if (element.cells[i].className != "no_hover") { oldcol_cellarray[i] = element.cells[i].style.backgroundColor; element.cells[i].style.backgroundColor='#e6f6f6'; } } } } // ----------------------------------------------------------------------------------------------- function hover_out(element) { if (! element) element = this; while (element.tagName != 'TR') { element = element.parentNode; } if (element.style.fontWeight != 'bold') { for (var i = 0; i<element.cells.length; i++) { if (element.cells[i].className != "no_hover") { if (typeof oldcol_cellarray != undefined) { element.cells[i].style.backgroundColor=oldcol_cellarray[i]; } else { element.cells[i].style.backgroundColor='#ffffff'; } //var oldcol_cellarray = new Array(); } } } } // ----------------------------------------------------------------------------------------------- function get_first_state(element) { while (element.tagName != 'TR') { element = element.parentNode; } first_state = element.cells[0].firstChild.checked; } // ----------------------------------------------------------------------------------------------- function checkit (element) { while (element.tagName != 'TR') { element = element.parentNode; } if (element.cells[0].firstChild.type == 'radio') { var typ = 0; } else if (element.cells[0].firstChild.type == 'checkbox') { typ = 1; } if (element.cells[0].firstChild.checked == true && typ == 1) { if (element.cells[0].firstChild.checked == first_state) { element.cells[0].firstChild.checked = false; } set_rowstyle(element, element.cells[0].firstChild.checked); } else { if (typ == 0 || element.cells[0].firstChild.checked == first_state) { element.cells[0].firstChild.checked = true; } set_rowstyle(element, element.cells[0].firstChild.checked); } if (typ == 0) { var table = element.parentNode; if (table.tagName != "TABLE") { table = table.parentNode; } if (table.tagName == "TABLE") { table=table.tBodies[0].rows; //var table = document.getElementById("js_tb").tBodies[0].rows; for (var i = 1; i< table.length; i++) { if (table[i].cells[0].firstChild.checked == true && table[i] != element) { table[i].cells[0].firstChild.checked = false; } if (table[i].cells[0].firstChild.checked == false) { set_rowstyle(table[i], false); } } } } } function set_rowstyle(r, on) { if (on == true) { for (var i =0; i < r.cells.length; i++) { r.style.fontWeight = 'bold'; r.cells[i].style.backgroundColor = '#f2f2c2'; } } else { for ( i =0; i < r.cells.length; i++) { r.style.fontWeight = 'normal'; r.cells[i].style.backgroundColor = '#ffffff'; } } } It is working as expected in IE. But coming to firefox i am surprised on seeing the output after so much of coding. In Firefox:-- onMouseOver is working as expected. color change of that particular row. onClick -- Setting the background color permenantly..eventhough i do onmouseover on different rows. the clicked row color is not reset to white. -- not as expected onclick on 2 rows..the background of both the rows is set...not as expected i.e if i click on all the rows..background color of everything is changed... Eventhough i click on the row. First column i.e radio button or checkbox is not set.. Please help me to solve this issue in firefox. Do let me know where my code needs to be changed... Thanks in advance!!

    Read the article

  • HTML + javascript mouse over, mouseout, onclick not working in firefox.

    - by lucky
    Hello Everyone, My question is to get onMouseover,onMouseout,onMousedown,onClick on a table row. For which i am calling javascript userdefined functions. onMouseover --- Background color should change. onMouseout --- Reset to original color onClick --- First column checkbox/radio button should be set and background color should change onMousedown --- background color should change. My code in html is:- <tr onMouseOver="hover(this)" onMouseOut="hover_out(this)" onMouseDown="get_first_state(this)" onClick="checkit(this)" > and the methods in javascripts are:- var first_state = false; var oldcol = '#ffffff'; var oldcol_cellarray = new Array(); function hover(element) { if (! element) element = this; while (element.tagName != 'TR') { element = element.parentNode; } if (element.style.fontWeight != 'bold') { for (var i = 0; i<element.cells.length; i++) { if (element.cells[i].className != "no_hover") { oldcol_cellarray[i] = element.cells[i].style.backgroundColor; element.cells[i].style.backgroundColor='#e6f6f6'; } } } } // ----------------------------------------------------------------------------------------------- function hover_out(element) { if (! element) element = this; while (element.tagName != 'TR') { element = element.parentNode; } if (element.style.fontWeight != 'bold') { for (var i = 0; i<element.cells.length; i++) { if (element.cells[i].className != "no_hover") { if (typeof oldcol_cellarray != undefined) { element.cells[i].style.backgroundColor=oldcol_cellarray[i]; } else { element.cells[i].style.backgroundColor='#ffffff'; } //var oldcol_cellarray = new Array(); } } } } // ----------------------------------------------------------------------------------------------- function get_first_state(element) { while (element.tagName != 'TR') { element = element.parentNode; } first_state = element.cells[0].firstChild.checked; } // ----------------------------------------------------------------------------------------------- function checkit (element) { while (element.tagName != 'TR') { element = element.parentNode; } if (element.cells[0].firstChild.type == 'radio') { var typ = 0; } else if (element.cells[0].firstChild.type == 'checkbox') { typ = 1; } if (element.cells[0].firstChild.checked == true && typ == 1) { if (element.cells[0].firstChild.checked == first_state) { element.cells[0].firstChild.checked = false; } set_rowstyle(element, element.cells[0].firstChild.checked); } else { if (typ == 0 || element.cells[0].firstChild.checked == first_state) { element.cells[0].firstChild.checked = true; } set_rowstyle(element, element.cells[0].firstChild.checked); } if (typ == 0) { var table = element.parentNode; if (table.tagName != "TABLE") { table = table.parentNode; } if (table.tagName == "TABLE") { table=table.tBodies[0].rows; //var table = document.getElementById("js_tb").tBodies[0].rows; for (var i = 1; i< table.length; i++) { if (table[i].cells[0].firstChild.checked == true && table[i] != element) { table[i].cells[0].firstChild.checked = false; } if (table[i].cells[0].firstChild.checked == false) { set_rowstyle(table[i], false); } } } } } function set_rowstyle(r, on) { if (on == true) { for (var i =0; i < r.cells.length; i++) { r.style.fontWeight = 'bold'; r.cells[i].style.backgroundColor = '#f2f2c2'; } } else { for ( i =0; i < r.cells.length; i++) { r.style.fontWeight = 'normal'; r.cells[i].style.backgroundColor = '#ffffff'; } } } It is working as expected in IE. But coming to firefox i am surprised on seeing the output after so much of coding. In Firefox:-- onMouseOver is working as expected. color change of that particular row. onClick -- Setting the background color permenantly..eventhough i do onmouseover on different rows. the clicked previous row color is not reset to white. -- not as expected onclick on 2 rows..the background of both the rows is set..Only the latest row color should be set. other rows that are selected before should be set back..not as expected i.e if i click on all the rows..background color of everything is changed... Eventhough i click on the row. First column i.e radio button or checkbox is not set.. Please help me to solve this issue in firefox. Do let me know where my code needs to be changed... Thanks in advance!!

    Read the article

  • how can i return a string with jQuery from an input and write it to a different html element

    - by user1865231
    I am using this: var title = $('#input').val(); $('#titleset').click(function (){ $('#title').html('<h1>' + title + '</h1>'); alert(title); }); to try to get the value of an input box and then when the user clicks the button #titleset, overwrite the value from the input box to the <h1> element that is already there. i have been able to get the click to overwrite the <h1> element, but there is nothing in the title variable to write into the element. so how could i return a string from the #input id and write it to the #title id which is an <h1> element here is my html <h1 id="title">This Title Changes To What You Want It To Be</h1> <ul class="menu1"> <li>menu one <ul> <li id='inputbox'><input type ="text" id="input"/></li> <li id="titleset1"><input type="button" value="set title" id="titleset"/></li> </ul> </li> </ul>

    Read the article

  • IE8 v8 not changing class for a DOM element despite JS function changing the element attribute

    - by Alfabravo
    I have an on-screen keyboard in order to provide a safer input for passwords. The keyboard itself is placed like this: <div class="teclado_grafico" id="teclado_grafico"> <a class="tecla_teclado" onmousedown="teclaAction( this, 'caja_selector'); return false" style="top: 0px; left: 0px;">Q</a> <a class="tecla_teclado" onmousedown="teclaAction( this, 'caja_selector'); return false" style="top: 0px; left: 28px;">W</a> . . . </div> And it has a "Shift button" which fires a JS function with this (I've already tried all that, indeed): if (obj.innerHTML == "Mayus.") { try { MAYUSCULA_ACTIVADO = !MAYUSCULA_ACTIVADO; var tgrafico = document.getElementById("teclado_grafico"); if(MAYUSCULA_ACTIVADO) { // tgrafico.className = "teclado_grafico mayuscula"; // $("#teclado_grafico").removeClass('minuscula').addClass('mayuscula'); // $("#teclado_grafico").attr('class', 'teclado_grafico mayuscula'); // $("#teclado_grafico").attr('className', 'teclado_grafico mayuscula'); tgrafico.setAttribute('className', "teclado_grafico mayuscula") || tgrafico.setAttribute('class', "teclado_grafico mayuscula"); } else { // tgrafico.className = "teclado_grafico minuscula"; // $("#teclado_grafico").removeClass('mayuscula').addClass('minuscula'); // $("#teclado_grafico").attr('class', 'teclado_grafico minuscula'); // $("#teclado_grafico").attr('className', 'teclado_grafico minuscula'); tgrafico.setAttribute('className', "teclado_grafico minuscula") || tgrafico.setAttribute('class', "teclado_grafico minuscula"); } } catch (_E) { //void } return; } The associated CSS is like this: .mayuscula a.tecla_teclado{ text-transform: uppercase; } .minuscula a.tecla_teclado{ text-transform: lowercase; } It works on every single browser I've tried. IE 6, 7; Opera 10; GChrome; FF 3, 3.5 and 3.6; Safari 4,... but in IE8 v8 (strict mode) the class is not changed! I mean, debuggin' with the IE8 tools allows one to see that the attribute className is there and it changes... but the user does not see the letters changing from uppercase to lowercase, to uppercase again. I just don't know how to handle this... I had complains about the client using IE6... now they updated their stuff and this shows up. Any help will be reaaaaly helpful!

    Read the article

  • Element 'Chart' is not a known element - dotnetCHARTING

    - by Ryan
    Hi, I am using dotnetCHARTING: the dll is installed in the GAC and referenced in my web.config (all versions appear to match). The project has a reference to the dll. web.config: <add assembly="dotnetCHARTING, Version=5.3.3540.17054, Culture=neutral, PublicKeyToken=af2cd47db69d93bd"/> The site code compiles ok, but all aspx pages using the charting library complain that the Chart tag does not exist (warning that it might be a compile error). The aspx pages do not render the charts. Each page has a reference to the assembly: <%@ Register Assembly="dotnetCHARTING" Namespace="dotnetCHARTING" TagPrefix="dotnetCHARTING" %> Does anybody know what could be causing this? Thanks a lot for any help - I'm quite desperate to get this resolved. Ryan

    Read the article

  • jquery: how to find an element which is comming 2 elements before current element

    - by erkan
    Hi guys... i have a markup which look like this: <h3>Paragraf3-dummytext</h3> <p> <a name="paragraf3"> Quisque id odio. Praesent venenatis metus at tortor pulvinar varius. Lorem ipsum dolor sit </a> </p> what i want to do is to find all 'a' tags with 'name' attribute and find the 'h3' tag for that anchor; im trying to do it like this: var paragraf = []; var paragrafheading = []; $('a[name]').each(function() { paragraf.push($(this).attr('name')); paragrafheading.push($(this).prev().text()); but it does not work becouse there is a 'p' tag around the text. Any suggestions would be appreciated. Thanks

    Read the article

  • Absolutely positioned element inside fixed positioned element

    - by Salman A
    Related to my previous question, I have a <div style="position: fixed;"> footer. The footer contains <a style="display: block; float: left;"> elements. Upon clicking one of these links I want a div to popup above that link. I am experimenting with a couple of CSS settings and got acceptable results but I am not sure if my CSS will work across browsers. I am wondering if some one can tell me a bullet proof and tested CSS solution to achieve something like this:

    Read the article

  • XSLT 1.0 grouping to reformat element defined by date into element defined by task

    - by Daniel
    Hi folks, I have a tricky XSLT transformation and I'd like your advise My xml is formatted as below: <Person> <name>John</name> <date>June12</date> <workTime taskID=1>34</workTime> <workTime taskID=2>12</workTime> </Person> <Person> <name>John</name> <date>June12</date> <workTime taskID=1>21</workTime> <workTime taskID=2>11</workTime> </Person> The output xml should be: <Person> <name>John</name> <taskID>1</taskID> <workTime> <date>June12</date> <time>34</time> </worTime> <workTime> <date>June13</date> <time>21</time> </worTime> </Person> <Person> <name>John</name> <taskID>2</taskID> <workTime> <date>June12</date> <time>12</time> </worTime> <workTime> <date>June13</date> <time>11</time> </worTime> </Person> Essentially, as an input, a "Person" object gathers all the task/workTime for a specific date. As an output, I want the "Person" object to gather the date/workTime for a specific task. I need to use XLST 1.0. I've been trying to use grouping with key but get very puzzled. Appreciate your help. Daniel

    Read the article

  • XPath find element based on ancestor element

    - by martymcfly
    Hi, again I have Java AST which is created from public class Test { String o = new String("hh"); public void wrong1() { synchronized(o) { // huhu } } } I try to create a XPath query which finds the synchronized block in which the defined String variable o is used. As the definition is above it is an ancestor of the SynchronizedStatement, but I dont get it working //SynchronizedStatement[Expression/PrimaryExpression/PrimaryPrefix/Name[@Image=ancestor::ClassOrInterfaceBody[ClassOrInterfaceBodyDeclaration/FieldVariableDeclaratorId/@Image]]] I know that /SynchronizedStatement[Expression/PrimaryExpression/PrimaryPrefix/Name[@Image= is correct, my problem is how to address the ancestor ClassOrInterfaceBody part. Hope its clear what i mean ;-) Thanks

    Read the article

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