Home > UI/UX Development > jQuery (Page 3)

Calculate height and width of an element with respect to window/document height and width

Get height of window $(window).height(): Returns height of visible viewport/screen (does not include height of scrollable content) Get height of the page $(document).height(): Returns height of the length of the content/page (includes the height of the scrollable content) Get width of window $(window).width(): Returns width of visible viewport minus width of scrollbar

This Article is TAGGED in , , . Read more

Add Videos using media upload URL in WordPress

We have seen how to add WordPress media upload button in a page or metabox. You can find the steps here. Similarly you can also add a media upload button for videos, since the above link has media upload type as image media-upload.php?type=image&TB_iframe=true How do we upload videos instead? Follow the steps

This Article is TAGGED in , , . Read more

Selectors! Types and difference

Basic Selectors:Universal Selector: [crayon-6767db750262c491680112/]ID, Class Selector[crayon-6767db7502631201884423/]Element/ Tag Selector[crayon-6767db7502634022158629/]Attribute Selector[crayon-6767db7502637602552895/]Descendant Selector: Selects all elements(any level deep) that are under the selector. For ex. following code will select all the span elements that are inside div element.[crayon-6767db7502639350682878/]Child Selector: Selects all elements that are one level under the selector. For ex. following code will select all the span elements at

Read more

WordPress – Jquery get dynamic urls(admin_url, template_directory)

WordPress provides a series of methods and global variables for getting the current url, template directory, plugin directory, includes directory, admin directory that saves us from using absolute paths. On the other hand JQuery under wordpress does not include such urls so we end up using absolute urls. A workaround for this

This Article is TAGGED in , , , . Read more

set maxlength to all textbox/textarea in application using jquery.

Add a textbox with id and maxlength attributes like [crayon-6767db750283e094767862/] add following code in js file. (this code find all textbox/textarea in application and append div(charleft) to the textbox/textarea.) [crayon-6767db7502843189038230/]   and add following css [crayon-6767db7502846618319371/] :)  

This Article is TAGGED in , , , , , . Read more

Event bubbling and capturing in Javascript

Event bubbling and event capturing are two ways of event propagation in DOM structure.Ex. There are two HTML elements embedded in one another as:Event bubbling: the event is captured in span element first and then in div.Event Capturing: the event is captured in div element first and then in span.Browser Support: In older

This Article is TAGGED in , . Read more