[Solved] How to make page loaders/animations/transitions

I go about it by providing different states for your page (eg. loading, loaded, and error). And passing in a status parameter, then using css to add a display: none class to it. (the hide class is display: none) function setStatus(status) { document.getElementById(“loading”).classList.add(“hide”); document.getElementById(“contents”).classList.add(“hide”); if (status == “loaded”) { document.getElementById(“contents”).classList.remove(“hide”); } if (status == “loading”) … Read more

[Solved] Unwanted white space on mobile version

Welcome to Stack Overflow. As Dylan pointed out, you should put more detail in your post so others can find answers in your questions. Please update your question to include relevant code and more specific details. Regardless, I did some poking around and found out that your “margmarg” class has margins that are blowing out … Read more

[Solved] Regular Expression to get text from css

If you have CSS styles isolated in a javascript string, you can get the width value with this regex: var re = /\.body\s*\{[^\}]*?width\s*:\s*(.*);/m; var matches = str.match(re); if (matches) { var width = matches[1]; } Test case here: http://jsfiddle.net/jfriend00/jSDeJ/. The height value can be obtained with this regex: \.body\s*\{[^\}]*?height\s*:\s*(.*);/m; If you just want the text … Read more

[Solved] Parsing webpages to extract contents

Suggested readings Static pages: java.net.URLConnection and java.net.HttpURLConnection jsoup – HTML parser and content manipulation library Mind you, many of the pages will create content dynamically using JavaScript after loading. For such a case, the ‘static page’ approach won’t help, you will need to search for tools in the “Web automation” category.Selenium is such a toolset. … Read more

[Solved] JS condition change class

You need just innerHTML/innerText method and set of conditions. No jQuery needed. var el = document.getElementById(‘polIndice’); var val = parseInt(el.innerText); var class_name; if (val < 50) { class_name=”indiceLow”; } else if (val < 100) { class_name=”indiceMedium”; } else { class_name=”indiceHigh”; } el.className += ‘ ‘ + class_name; http://jsfiddle.net/hyuu5w5z/ 1 solved JS condition change class

[Solved] Swap out html table for new table [closed]

If you already have the two tables in that screen you can simply make one of them invisible using CSS style=”display:none” and use javascript to access them and switch the display attribute between them each time you want to swap. javascript code to switch would be document.getElementById(“elementID”).style.display=”; (to show) document.getElementById(“elementID#2”).style.display=’none’; (to hide) 1 solved Swap … Read more

[Solved] I’m trying to make fixed header change it’s background-color after I scroll the page 100px

jQuery(document).scroll(function() { var y = jQuery(this).scrollTop(); if (y > 100) { jQuery(‘#menu’).addClass(‘scrollActive’); } else { jQuery(‘#menu’).removeClass(‘scrollActive’); } }); and just add in your CSS #menu.scrollActive { background-color: blue; // or color what you want; } solved I’m trying to make fixed header change it’s background-color after I scroll the page 100px

[Solved] copy all css property [closed]

$(‘.past’).addClass($(‘.copy’) but if you want to do it with another way Working Demo $(document).ready(function(){ $(“.copy”).click(function(){ var array = [‘color’,’width’,’height’, ‘background-color’, ‘border’]; var $this = $(this); $.each( array , function(item, value) { $(“.past”).css(value, $this.css(value)); }); }); }); another way or you can say the best way Working Demo Source (function($){ $.fn.getStyleObject = function(){ var dom = … Read more

[Solved] Copy image CSS from another website

Here is the css you want to add to make that photo round and small .client-pic { width: 80px; height: 80px; border-radius: 50%; } Tip for the future, if you want to scrape code off of other websites, use inspect element browser feature to get to css used on any specific element. solved Copy image … Read more

[Solved] How to change all my value with onclick?

You have a function, but you’re not calling it. Try changing the onclick() to change() and selecting the element using this, (as a parameter). function change(elem) { if (elem.value == “E”) elem.value += “\u266D”; else elem.value = “E”; } <!DOCTYPE html> <html> <head> <meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″> <link href=”https://fonts.googleapis.com/css?family=Ubuntu” rel=”stylesheet”> <title>Afinador de Violão</title> <meta name=”viewport” … Read more

[Solved] How can I make an effect of fading shadow with css3?

Use something like this Which uses something like: .knockout-top-to-bottom { position: relative; } .knockout-top-to-bottom:before, .knockout-top-to-bottom:after { content: “”; position: absolute; } .knockout-top-to-bottom:before { top: -3px; left: -3px; bottom: 0; right: -3px; background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#000), to(transparent)); background-image: -webkit-linear-gradient(#000, transparent); background-image: -moz-linear-gradient(#000, transparent); background-image: -o-linear-gradient(#000, transparent); z-index: -2; } .knockout-top-to-bottom:after { z-index: -1; … Read more