Web Dev
Centering Multiple Floated Elements
The need was to have multiple floated fixed-width elements, sometimes two, sometimes three, to stay centered on the page without needing to adjust the html code. Not as easy as one would think. Of course its easy if you know how many elements you are going to have, and thus know the width that the […]
Read MoreChanging Values and Properties with jQuery
jQuery excels at making it easy to change values and properties. Here are a few samples: Change a Select Box Value Changing which value is selected in a select box (this will select the item in the select box with the value of 126): $(‘#catID’).val(‘126’); Change the Background Color of a Textbox $(‘#textbox’).css({‘background-color’:’red’}); Checking a […]
Read MoreVertical Aligning Within a Div
Vertically aligning text within a div really isn’t too bad — its just not very intuitive. There is the css tag ‘vertical-align’, but this only applies to a small range of instances where this actually works (this tag really should apply to actually vertically aligning all possibilities). To vertically align within a div, just give […]
Read MorejQuery Effects
Many effects are made easy with jQuery: Hiding and Showing hide Hides an html element, for example: $(‘menu_sub’).hide(); show Shows an html element: $(‘menu_sub’).show(); toggle Switches and elements display — if hidden, it displays it, if it\’s currently displayed, it hides the element. $(‘menu_sub’).toggle(); fadeIn In the code below, the ‘500’ is the speed in […]
Read MoreCSS Drop Shadows
Adding drop shadows to elements with CSS is fairly easy: .shadow { box-shadow: 3px 3px 4px #000; } Theoretically, you just need the bottom declaration (box-shadow), but older browsers that don\’t fully support it utilize the other declarations. The format for all of these is the same: box-shadow: x-offset y-offset shadow blur radius color ; […]
Read MoreCSS Rounded Corners
Rounding All Corners of an Element: Basic rounded corners (all corners of the element will be rounded): #example { -moz-border-radius: 15px; //Mozilla tag border-radius: 15px; //Standard tag for all browsers } Targeting Specific Corners: Both W3C and Mozilla specifications are given. Both will need to be listed for the rounded corners to […]
Read MorejQuery Ajax
Making calls to the website’s database without page refreshes is pretty easy with jQuery. There are several functions that can be used, including load, get, and post: Load load() provides the ability to load an html file into an element: $(‘#divContent’).load(‘content_file.html’); With load(), you can even specify specific areas of a file to display. The […]
Read MorejQuery Events
Events Run a function (ie: ‘functionName’) when the mouse goes over the ‘a’ tag: $(‘a’).mouseover(functionName); Mouse Events click dblclick mousedown mouseup mouseover mouseout mousemove Document/Window Events load resize scroll unload Form Events submit reset change focus blur Keyboard Events keypress keydown keyup Getting The ID Of The Element That Triggerd An Event Use the ‘event.target.id’ […]
Read MoreGetting Started With jQuery
Utilizing jQuery actually makes working with javascript somewhat pleasant. It’s pretty easy to get started. To begin using jQuery, connect to the jquery script, and place your code within the document.ready function. It’s best to link to the latest version of jQuery that is hosted by Google. By linking to Google’s version, it will likely […]
Read MoreServing Websites to Other Computers on a Local Network with XAMPP
I have been using XAMPP to test PHP websites on my local computer for years, but since adding another computer to my small office, I have encountered the need to set up my computer as a server to host the pages that could then be viewed from other computers on my network. Turns out, it’s […]
Read More