Here is the code of a div aligned vertically.
#adiv{
display:inline-block;
vertical-align:middle;
}
This only works for div with the display property inline-block and some others which I don’t know. But it’s better to use inline-block.
Peace ☮️, Love 💙, Freedom 🕊 & Curiosity 👨💻
Posts marked with "Posts" in posts
#adiv{
display:inline-block;
vertical-align:middle;
}
This only works for div with the display property inline-block and some others which I don’t know. But it’s better to use inline-block.
if(strtolower($_SERVER[‘HTTP_X_REQUESTED_WITH’])==’xmlhttprequest’){
echo "The request is from an Ajax Call";
}else{
echo "The request is not from an Ajax Call";
}
?>
There you go. You now know how to check whether request made to file is from an Ajax Call or not in PHP.
To scroll horizontally with CSS is very annoying, because the whole page will move vertically and sometimes the Y axis will scroll. So I decided to use jQuery and it’s very simple. Only 237 characters which is only 2 lines. Here is the **jQuery **code with the div id #scrollho.
$('#scrollho').on('mousewheel',function(e){
e.preventDefault();
scrollLeft=$('#scrollho').scrollLeft();
if(e.originalEvent.wheelDeltaY.toString().slice(0,1)=='-'){
$('#scrollho').scrollLeft(scrollLeft+100);
}else{
$('#scrollho').scrollLeft(scrollLeft-100);
}
});
#scrollho{
overflow:hidden;
}
The #scrollho div’s scrollbars are hidden with CSS. When a mousewheel event occurs on #scrollho the default event is neutralized and the div is scrolled horizontally to the direction of the mousewheel using e.originalEvent.wheelDeltaY. **e.originalEvent.wheelDeltaY **is converted into string as to do the slice function to check whether the number is negative or not.
... [READ MORE]If you are adding GET parameters to file name like the following, then it won’t work:
The above code won’t load the file, because PHP Include function only looks for files, it won’t send any parameters. It will search for file.php?user=subin in the directory for the case above. You can make it work in a different way.
... [READ MORE]... [READ MORE]
But you could if you run a simple file in terminal. Here is how you could do it.
Create a file named normal.sh in your Desktop with the following contents:
#!/bin/bash
xrandr -s 0
Save it on a place where you can open it easily. Make the file Executable to run it in a terminal. See this post to see how you could make a file executable.
... [READ MORE]There is no specific command to logout in an Ubuntu system.
Here’s how it works. The desktop you’re seeing is a separate software. They are called Desktop Environments (DE). The default DE of Ubuntu is Unity from Ubuntu’s 11.04 versions. Before it was GNOME. There are many DEs for Ubuntu. Some of them are :
and many more.. There are also separate Login Managers to provide the login screen while Ubuntu is loaded. When you log in, the Login Manager starts the default DE set up on your system and when this DE program is closed or terminated, it will go back to the Login Screen or Login Manager.
... [READ MORE]
So I’m gonna tell you how to prevent the sidebar from fading out to the right side.
First of all Go to Blogger -> Template -> Customise
Choose Advanced option and click on the Add CSS button from the sub options. Paste the following code in the white box: