Tag: css

How to hide div when it's already open?

I couldn’t think of any better title, so I will try to explain my question here as clear as possible. I’m quite a newbie in JQuery so this is probably a very easy question. I have some divs with a button on it. When you click the button, another div should pop-up. My question is: […]

How to set a random color for each group of elements looping through an array?

I am trying to set a different colors using jquery on each .elements, their children (.element) should have the same color but the attribution of color should be random for each .elements. How can I do it ? Here’s an example : https://jsfiddle.net/auscpzy6/6/ Html <div class=”elements”> <!– children share the same color –> <div class=”element”>1</div> […]

creating a Scroll To Top button

I want to create a similar button as in Lenta.ru, with a smooth retractable effect, can you help me with that?

Rendering ember component outside parent template

Imagine the following situation. I have a sidebar positioned absolutely and then some more stuff positioned absolutely within that sidebar. In that sidebar I have a button, which shows a menu, the template looks like this: <button>Click me</button> {{#if shouldDisplayMenu}} {{view App.MyMenu}} {{/if}} What I like about this solution and want to keep is that […]

Syntax vs Element vs Tag vs attributes vs property vs selector?

Can anyone give me details on each? for example? Is #ID an attribute or property or selector or anchor? Is default property and default attributes are different thing? Are all these Tags or elements? What we will say to this <img src=”angry.gif” alt=”Angry face” title=”Angry face” /> This <div>…..</div> and these <br /> , <hr […]

How to change background of hovered and pressed extjs-button dynamically

Hy there, i need the ability to change the background-color for the different states (normal, hover, pressed) of a button dynamically. What i’ve came up with so far is the following: http://jsfiddle.net/suamikim/c3eHh/ Ext.onReady(function() { function updateBackground() { var theWin = win || this, // neccessary because of the call from the afterrender-event btn = theWin.down(‘#btnTest’), […]

Toggle div on link click

http://jsfiddle.net/FsCHJ/2/ what now happens is, whenever I have another link example it will also use this link as the toggle button. I just want Toggle Edit Mode to be toggling hidden div’s on/off. So I tried to change $(“a”).click(function () to $(“toggle”).click(function () and <a>Toggle Edit Mode</a> to Toggle Edit Mode`, but doesn’t work. Any […]

Ng-style not working for background

I need to set background of element from configuration object through ng-style, but I can’t do that for some unknown reason, it’s really weird for me and I really can’t find the reason why. The element I’m trying to configure: <div id=”progress-l” ng-style=”{ ‘width’: pblc.options.width, ‘height’: pblc.options.height, ‘background’: plbc.options.color }”></div> pblc stands for controller here, […]

Setting style doesn't work?

Why does this script not work? <!DOCTYPE html> <html> <head> <title>Hello StackOverflow!</title> </head> <body> <div id=”testing”> <p>Bladybla</p> </div> <script> var one = window.innerWidth; var two = 5; var three = one / two; var four = ‘”‘ + Math.round(three) + “px” + ‘”‘; document.getElementById(“testing”).style.marginTop = four; </script> </body> </html> When I place an alert between […]

Animating Glyphicon on click

I am trying to animate a glyphicon-refresh icon so that when I click on the icon it should rotate. I am trying to do this using CSS3, but it is not working properly. Here is my markup: <a id=”update” href=”#”><i class=”glyphicon glyphicon-refresh”></i></a> Here is my css: <style> .glyphicon-refresh-animate { animation-name: rotateThis; animation-duration: .5s; animation-iteration-count: infinite; […]