How to make input box show up from right to left?
Tags: css
Problem :
I have the following HTML:
<div class="menus">
<di class="menu-option">
Weather
</di>
<di class="menu-option">
Travel
</di>
<di class="menu-option">
<input class="search-input" />
<span class="search-btn">Search</span>
</di>
</div>
CSS
.menus {
float:right;
}
.menu-option {
display: inline-block;
border-left: 1px solid black;
padding: 0 15px;
}
.search-input {
display: none;
}
Javascript:
$('.search-btn').click(function(e) {
$('.search-input').show();
});
At this moment, I able to show the search box from hidden when clicking the Search text. How can I make the search box show up by moving from right to left and pushing other text to the left side, instead of showing the search box all of a sudden.
This is the JSFIDDLE example:
https://jsfiddle.net/1btm224h/5/
Thanks!
Solution :
You can go with:
$('.search-btn').click(function(e) {
$('.search-input').show("slow");
});
Or you can go with:
$('.search-btn').click(function(e) {
$('.search-input').show(3000);
});
From jQuery official: "The default duration is 400 milliseconds. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively."
So you only need to add animation duration, which is built into the .show() by default.
CSS Howto..
Change the margin-left element of #dd_ajax_float to something like -100px instead of -120px I was able to add this to your page and make it work..not sure where you are...
The simplest way would be to use Javscript to validate your fields. The better way is to post your data to a PHP script on your server. This can be...
Much of the refactoring work is the same with or without Compass and you'll see the benefits that Sass offers sooner than those of Compass. Compass creator Chris Eppstein did...
I managed to do it with this code: The function hasClass checks if an element has a specific class. The function menuMechanics disables the links. And adds or removes the...
You can always listen for the scroll event, and check the scrollTop value. Once you've reached the 50px threshold, you change the margin-top value: window.addEventListener('scroll', function(){ if (document.body.scrollTop >= 50)...
I've figured it out. So I have the <a name="anchor"></a> within my <h3></h3> and it's causing this issue. If I put the anchor tag outside the <h3> it's fine.
Presuming you want to remove the animation, change $(".content").hide(240); to $(".content").hide();
I was able to remove the extra line; however, I have not yet found a way to keep the value in the center without the number moving as the bar...
use this Demo1 Demo2 this will do the trick #outer { position: absolute; overflow: hidden; height: 200px; width:100%; // added this to make the outer div width 100% } Suggested...
It'll probably be supported by all browsers in the future, but as of now, I don't think it's a supported border type. Here's a test page someone made with the...
Let's start from a jsFiddle link : Here I think it's a good practice when you post question. Please explain where is the problem, in the jsfiddle page I don't...
So based of what you said above you want to have an element follow you down the page but change it's top position after you scroll down a little ways....
I believe this is what you want. You were setting the height on the wrong element. I played with the borders just to make it easier to see what's going...
You can't do this with the <select> element. You can't have endless nested subcategory like you suggest, only one, with <optgroup>. Styling will also be difficult as the ability to...
Write like this: body { background-image: url(/welcome/static/images/register_top2.png); background-position: center top; background-repeat:repeat-x; } OR you can write like this also: body { background: url(/welcome/static/images/register_top2.png) center top repeat-x; } ...
The white line is defined by the bootstrap css. So, You need to overwrite it's css. Like this: .navbar-default{ border:none; } ...
There's no way to hide this text using CSS, without adding a tag aground it- depending on how you're grabbing the site, your best bet would be to attempt to...
If the iframe source is yours to control: The simple answer is that you need to treat the iframe as a seperate webpage entirely, because really, it is exactly that....
Just reverse it before you obfuscate it... $email = 'blah@whatever.co.uk'; $new = convert_email_adr($email); echo '<span style="unicode-bidi:bidi-override; direction: rtl;">'.$new.'</span>'; function convert_email_adr($email, $reverse = true, $obfuscate = true) { $email = trim($email);...
I'm not sure if you wanted the sub-menu to appear on hover, but it's pretty trivial using straight CSS by adding these 2 classes: .header-nav-menu li > ul { display:...
If you use floats, you pretty much need to give them widths. Floats are fine if you specify the width or you're happy with whatever the browser calculates as the...
Try cut pattern separately from the gradient and put them on different layers. If you give PSD i can help you. Gradient will stretch across the width of the page,...
SWT uses the native widgets of the platform it runs on. Their appearance is controlled by the platform and cannot be changed by application code. The CSS styling is also...
Use CSS to hide it on devices bigger than mobile. To stop this code getting executed on every page wrap it into a if_front_page(). https://developer.wordpress.org/reference/functions/is_front_page/ if (is_front_page()) { // your...
Hey make a fonts folder with css folder and put the desired font there. Then in CSS call this code as example for MeriyoUI font as mentioned below. This would...
Taking away the width on the inner div should work, width: auto; will work with margins, and expand to the maximum horizontal area: <div id="#outer" style="width:100%; border: solid 1px red;">...
Here is a way but you've to specify a width: Bootply : http://www.bootply.com/79wWifpDzR Css: .dropdown-menu li > a:hover, .dropdown-menu li > a:focus, .dropdown-submenu:hover > a { background-image: none; background-color: #0C6A13;...
About the height part: You won't see the height if the content is less high than the parent element and if there is no background or border. Add something like...
It turns out I have to add the class to the image itself, not the erb string: <div class="parent"> <%= image_tag ("picture.png", class:"image") %> </div> ...
You are supposed to use Pseudo-classes img:hover For more detailed information refer this Pseudo-classes on MDN. Much better than w3schools....