All posts by
Adding elements with javascript
.append() You can add text or obvjects youve created NOTE YOU WON’T SEE THE RESULT WITH VIEW HTML !!!! When used inside a “jQuery(document).ready(function(){” for instance, the append happens by the browser after the page has loaded, so it will seem like it hasn’t worked if you view a pages html in the browser. You […]
Javascript in WordPress
$ causes a clash in wordpress so you need to Change the ‘$’ in this: to this: Reason: https://mkyong.com/jquery/jquery-is-not-working-in-wordpress-solution/
Page detect
Does Window have focus Trigger on page load
Toggle Options On and Off
Get calling element ID
Simple pop up box with changeable content
Add to top of HTML< after <body> tag – Normal Add to top of HTML< after <body> tag – WordPress (Same but needs the ‘$’ changed to ‘jQuery’ or you get “TypeError: $ is not a function” console errors) Links that will trigger a popup CSS Issues You can’t include a single quote in your […]
Show content when link clicked to reveal it
Changing href of a link
Use this in the page footer (after the element to be changed)
Adding onclick functionality to an html element
Use this in the page footer (after the element to be changed) Change the html content and add an on click submit form to a span