Tag: css

“Draggable” Drag vertical only?

I have this page that prompts you to drag it upwards to reveal the actual page. I want to know if there’s any option so that you only can drag it vertically (Y-axis) i.e. “up”. Is there any way to do this?

How to choose more than one option from a select box

i want to know how can we select more than one option from a select box like given below: <label for=”color”>Colors</label> <select class=”inputbox” name=”color” id=”color” style=”width:180px;”> <option value=”Black”>Black</option> <option value=”White”>White</option> <option value=”Tan”>Tan</option> <option value=”Navy”>Navy</option> <option value=”RoyalBlue”>Royal Blue</option> <option value=”Red”>Red</option> <option value=”Yellow”>Yellow</option> <option value=”Hunter(DarkGreen)”>Hunter(Dark Green)</option> <option value=”Kelly(Green)”>Kelly(Green)</option> <option value=”Burgundy”>Burgundy</option> </select> Thanks

Jquery if hasClass then addClass

I know I can do this, I’m just getting lost in the hierarchy and need a second set of eyes on this. Here’s the structure ‘m working with: <div class=”nav-column”> <ul> <li><a href=”#”>Link 01</a> <div> <ul> <li><a href=”#”>Sublink 01</a></li> <li><a href=”#”>Sublink 02</a></li> <li><a href=”#”>Sublink 03</a></li> </ul> </div> </li> <li><a href=”#”>Link 02</a></li> <li><a href=”#”>Link 03</a></li> </ul> […]

javascript add class to an element in a specific div

So I have this arrangement in my page: <div class=”food”> <div> <a href=”#” class></a> <a href=”#” class></a> </div> <div> <a href=”#” class></a> <a href=”#” class></a> </div> </div> How do I add a class to all the a elements inside my div.food? What is the shortest and quickest way to implement this? Thanks!

Showing only a part of image in div using css

What I have : I have a div of width 200px X 200px and image inside it of size 400px X 400 px. What I want to do : I want to show only a part of image inside div Is it possible using only css.If not ? Then what are the other ways (Note […]

Styling input field of dynamic ID using getElementById

I have some input fields that has its id’s number changes dynamically. For example, the below code shows an input field that has “id=”field14“. The word (field) in the id does not change, but the (number) is changing dynamically. So it may be field14, field13, or field20, etc, and there is no limit for numbers. […]

Position fixed when scrolled passed certain amount of pixels

I’m looking for a way to position the #header element of my page as “Fixed” only after having scrolled downward for about 170 pixels. Above the header is a banner, so when people scroll down, I would like the banner to scroll away, the header to stay fixed when it hits the top of the […]

How to always display the alt attribute of an anchor tag

How to always display the alt attribute of an anchor tag in HTML? Here is a situation where I have multiple repeating grids and I want to identify with date. So i want to show the title always, how can I achieve this? <a href=”#” title=”created at 12 october”>see details</a> <a href=”#” title=”created at 13 […]

Filter Table Row in Html

I have created a html page which has a search text and a table below with some data on it in the table I used the code available on JSFiddle But it did not worked. Please suggest something like the example shown I am using a simple html, css and javascript coding In this jquery […]

How can I turn the page's font color to green when a button is clicked

For example, this is my html code: ​<p style=”color:blue”>​I’m Blue</p> <p id=”p_red”>I’m Red​</p> <p>​I’m default, black</p> <input type=”button” id=”btn” value=”Set color” /> css: ​#p_red{ color: red; }​ I’d like to turn the page’s font color to green when the button is clicked: document.getElementById(“btn”).onclick = function(){ document.body.style.color = “green”; }​;​ But it seems that only the […]