Mobile app version of vmapp.org
Login or Join

Login to follow query

More posts by @Cugini213

2 Comments

Sorted by latest first Latest Oldest Best

 

@Si4351233

One easy way to achieve that function with a select menu is to show hide div's based on the selected option. Step two is just a list of articles related to the selected drop down.

A jsfiddle demo is here

The HTML

<Select id="colorselector">
<option value="red">Red</option>
<option value="yellow">Yellow</option>
<option value="blue">Blue</option>
</Select>
<div id="red" class="colors" style="display:none"> red... </div>
<div id="yellow" class="colors" style="display:none"> yellow.. </div>
<div id="blue" class="colors" style="display:none"> blue.. </div>​


The jQuery

$(function() {
$('#colorselector').change(function(){
$('.colors').hide();
$('#' + $(this).val()).show();
});
});​

10% popularity Vote Up Vote Down


 

@Goswami781

It's a form which by the looks of it uses Javascript (including jQuery) to make it, for example, submit the form when you pick a value from the initial dropdown.

You could examine the HTML and Javascript files on the site to work out exactly how it did it, or ask more detailed questions on stackoverflow.com on how to achieve specific things.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme