no-framework

Find last td without using Jquery

蓝咒 提交于 2019-12-25 07:50:03
问题 I need to find the Last td of every row in a HTML table, and remove a css from that td. Can I do it without using Jquery. How? 回答1: You can use css3 last-child property for this. Write like this: tr td:last-child{ color:red; } But it's not work in IE8 & below. 回答2: Use CSS td:last-child: { //your style here } Docs on CSS3 selectors here or using traverse the DOM using JavaScript : var mytable = document.getElementById('tableid'); var myrows = mytable.getElementsByTagName("tr"); var lastrow =

JavaScript range slider / dual slider exist withOUT using a framework [closed]

只谈情不闲聊 提交于 2019-12-23 08:46:40
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I'm looking for a JavaScript control that is a Range Slider (dual knob) that: does NOT use an existing JS framework (e.g. dojo, jquery

JavaScript range slider / dual slider exist withOUT using a framework [closed]

巧了我就是萌 提交于 2019-12-23 08:46:27
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I'm looking for a JavaScript control that is a Range Slider (dual knob) that: does NOT use an existing JS framework (e.g. dojo, jquery

List of All Background Images in DOM

天涯浪子 提交于 2019-12-18 11:55:38
问题 What's the best way to find all of the background images on a given page using javascript? The ideal end result would be an array of all of the url's. 回答1: // alert(getallBgimages()) function getallBgimages(){ var url, B= [], A= document.getElementsByTagName('*'); A= B.slice.call(A, 0, A.length); while(A.length){ url= document.deepCss(A.shift(),'background-image'); if(url) url=/url\(['"]?([^")]+)/.exec(url) || []; url= url[1]; if(url && B.indexOf(url)== -1) B[B.length]= url; } return B; }

is it possible that iframe resize itself without help from main window?

三世轮回 提交于 2019-12-17 12:06:50
问题 Both main window and iframe are on the same domain, but what I want to achieve is to resize iframe to fit its contents using js only within that iframe. I also do not know the id of the iframe that is assigned to it by main window. And I do not want to use jquery or any other framework for it. 回答1: You can do this also without knowing the id of the iframe in the parent window: window.frameElement.style.width = iframeContentWidth + 'px'; window.frameElement.style.height = iframeContentHeight +

is it possible that iframe resize itself without help from main window?

跟風遠走 提交于 2019-12-17 12:06:07
问题 Both main window and iframe are on the same domain, but what I want to achieve is to resize iframe to fit its contents using js only within that iframe. I also do not know the id of the iframe that is assigned to it by main window. And I do not want to use jquery or any other framework for it. 回答1: You can do this also without knowing the id of the iframe in the parent window: window.frameElement.style.width = iframeContentWidth + 'px'; window.frameElement.style.height = iframeContentHeight +

is it possible that iframe resize itself without help from main window?

夙愿已清 提交于 2019-12-17 12:06:06
问题 Both main window and iframe are on the same domain, but what I want to achieve is to resize iframe to fit its contents using js only within that iframe. I also do not know the id of the iframe that is assigned to it by main window. And I do not want to use jquery or any other framework for it. 回答1: You can do this also without knowing the id of the iframe in the parent window: window.frameElement.style.width = iframeContentWidth + 'px'; window.frameElement.style.height = iframeContentHeight +

What is an efficient way to set CSS class for each cell in a given table row?

我们两清 提交于 2019-12-14 02:11:40
问题 I have a problem setting the CSS class for each cell in a given table row. Initially I thought setting the parent row CSS would affect the style properties of cells, but that doesn't work. Instead I have to loop through all the cells in a given row to updated the CSS class. However this is not efficient. And it took a lot of time. Consider my situation: I have around 230 rows in which each row has 23 cells (totally 5290 cells). Note: I don't use any frameworks. so please can you suggest an

Read Attributes of SVG-Elements in HTML via JS

[亡魂溺海] 提交于 2019-12-04 15:09:33
问题 I have the following markup (HTML with native SVG): <!doctype html> <!-- ... html-Elements ... --> <svg version="1.1" ... > <defs> <circle id="infop" cx="0" cy="0" r="9" /> </defs> <!-- ... svg Elements ... --> <svg> <!-- to have separate coordinate-system --> <g id="outSvg"></g> </svg> ... A js-method outputs a line and several <use href="infotop"> Elements to #outSvg (to become a graph). The <use> Elements have onmouseover-Events to show tooltips. Now, when it comes to retrieving the

List of All Background Images in DOM

风流意气都作罢 提交于 2019-11-30 05:09:19
What's the best way to find all of the background images on a given page using javascript? The ideal end result would be an array of all of the url's. // alert(getallBgimages()) function getallBgimages(){ var url, B= [], A= document.getElementsByTagName('*'); A= B.slice.call(A, 0, A.length); while(A.length){ url= document.deepCss(A.shift(),'background-image'); if(url) url=/url\(['"]?([^")]+)/.exec(url) || []; url= url[1]; if(url && B.indexOf(url)== -1) B[B.length]= url; } return B; } document.deepCss= function(who, css){ if(!who || !who.style) return ''; var sty= css.replace(/\-([a-z])/g,