[Solved] Datepicker validation 18 years of age [closed]

If you look down the demo page a bit, you’ll see a “Restricting Datepicker” section. Use the dropdown to specify the “Year dropdown shows last 20 years” demo , and hit view source: $(“#restricting”).datepicker({ yearRange: “-20:+0”, // this is the option you’re looking for showOn: “both”, buttonImage: “templates/images/calendar.gif”, buttonImageOnly: true }); You’ll want to do … Read more

[Solved] The event handler to select

DEMO HTML: <select id=”cd-dropdown” class=”cd-select”> <option value=”-1″ selected>Choose an animal</option> <option value=”1″ class=”icon-monkey”>Monkey</option> <option value=”2″ class=”icon-bear”>Bear</option> <option value=”3″ class=”icon-squirrel”>Squirrel</option> <option value=”4″ class=”icon-elephant”>Elephant</option> </select> <div id=”div1″ class=”animalDiv”>MONKEY</div> <div id=”div2″ class=”animalDiv”>BEAR</div> <div id=”div3″ class=”animalDiv”>SQUIRREL</div> <div id=”div4″ class=”animalDiv”>ELEPHANT</div> CSS: .animalDiv { display:none; } JS/jQuery: $(function() { $(‘#cd-dropdown’).dropdown({ gutter: 5, stack: false, delay: 100, slidingIn: 100, onOptionSelect: function(e) { … Read more

[Solved] How to toggle css visibility with Javascript

Basically your Javascript could be shortened to: $(“.question”).click(function(argument) { $(this).parent().find(“.answer”).removeClass(“hideinit”).addClass(“display”); }); In order to make this work the only other thing you need to do is to make question a class rather than as an id. That looks like: <p class=”answer hideinit”>the answer</p> See the fiddle here Edit: Add Hide / Show To get this … Read more

[Solved] Center 4 quadratic (1:1) divs in one big quadratic div? [closed]

Use CSS-Grid to make the grid layout with equal split body{ margin:0; } .parent{ position: fixed; height: calc(100% – 20px); width: calc(100% – 20px); background-color: green; display: grid; grid-template-columns: repeat(2, 1fr); grid-gap: 10px; padding: 10px; } .child{ background-color:white; } <div class=”parent”> <div class=”child”> </div> <div class=”child”> </div> <div class=”child”> </div> <div class=”child”> </div> </div> Flex … Read more

[Solved] change the css via php [closed]

To sum up the discussions regarding your question: There (could be) no need to do this serverside. You can read the values of those options via Javascript and change the styles accordingly. You only need php, if you want to remember those settings for the user in a database or something like that. It is … Read more

[Solved] CSS Center text inside paragraph [duplicate]

Flexbox solution – the more modern solution: https://jsfiddle.net/2zqeL6g8/ The HTML: <div class=”todo”> <div class=”todo-left”> <p>TODO 1</p> </div> <div class=”todo-right”> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed rhoncus aliquam egestas. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed rhoncus aliquam egestas.</p> </div> </div> The CSS: .todo { display: flex; } .todo-left { background: … Read more

[Solved] Unknown space between my list elements [duplicate]

I would recommend using flexbox for this or you can use one of the methods listed in the following codepen. Flex box version: ul.flexbox { display: -webkit-box; /* OLD – iOS 6-, Safari 3.1-6 */ display: -moz-box; /* OLD – Firefox 19- (buggy but mostly works) */ display: -ms-flexbox; /* TWEENER – IE 10 */ … Read more

[Solved] Moving An Absolute Position Element Based Off Of Its Center

I think this is what you are trying to do is to use CSS transforms property with the value translate. #your-div-id { -ms-transform: translate(-50%, 50%); /* IE 9 */ -webkit-transform: translate(-50%, 50%); /* Safari */ transform: translate(-50%, 50%); } The value -50% controls X-axis, and 50% is for the Y-axis PS: play around the values … Read more

[Solved] rem units do not affect DIVs in Chrome – side-effect of minimum font size setting

Turns out Chrome has this setting – “Minimum font size” (chrome://settings/fonts?search=minimum). So if you manage to make the reference fontSize smaller than what is set there, whole rem logic will break. Here’s how it was set in the problematic Chrome. solved rem units do not affect DIVs in Chrome – side-effect of minimum font size … Read more