jQuery Get Browser Width

Using jQuery can I get the width of the browser window? Whilst developing a new theme I wished to handle a feature according to the width of the browser. $(window).width(); I like to create my own jQuery variable, with the aim that I shall avoid conflict: var $VNTweb = jQuery.noConflict(); I created a function function […]

Read More… from jQuery Get Browser Width

JavaScript Test if not Undefined

Applying JavaScript actions to an ID, which doesn’t exist, creates an undefined error. As an example consider the following HTML. The DIV has been assigned the id introMain, but is incorrectly referenced in the JavaScript as intromain. <html> <head> <title></title> <meta content=””> <style></style> </head> <body> <div id=”introMain” style=”display:none;” >Intro text </div> <script type=”text/javascript”> var item […]

Read More… from JavaScript Test if not Undefined

jQuery Replace Double and Single Quotes

I Wanted to be able to replace the double quotes in a menu with single quotes. For some menu items I was including a double quote around a part of the title. Shown below, are examples entries from the menu <ul class=”dropdown-menu” role=”menu”> <li id=”menu-item-9″><a title=”Carrots” href=”https://localhost/carrots/” class=”dropdown-item”>Carrots</a></li> <li id=”menu-item-1″><a title=””Sprouts”” href=”https://localhost/srouts/” class=”dropdown-item”>“Sprouts”</a></li> <li id=”menu-item-7″><a […]

Read More… from jQuery Replace Double and Single Quotes

$.browser is undefined

Following the update of WordPress perhaps a feature in one of the plugins has stopped. Reviewing the page errors with the browser inspector shows the error $.browser is undefined I have also encountered the $.browser is undefined error when I took over a website and updated the jQuery references as a part of my initial […]

Read More… from $.browser is undefined

Add Scroll Top Image

When the web page has scrolled down an offset distance show a scroll to top image. When redesigning the VNTweb website, thinking about the longer article pages, I chose to add one of these. Scrolling the page down shows on image in a fixed location. Clicking on this image shall scroll the page back to […]

Read More… from Add Scroll Top Image