|| Thema: JQuery || Titel: Ajax - Table edit in place ||
|| Beitrag erstellt von: develop am 3. November ||



|| Thema: JQuery || Titel: JQuery - Parallax ||
|| Beitrag erstellt von: develop am 26. Oktober ||



|| Thema: JQuery || Titel: JQuery - Doing stuff with Elements ||
|| Beitrag erstellt von: develop am 30. Juli ||

JQuery - Doing stuff with Elements

jQuery('div#primary').width(300);
Set the width of div id=“primary” to 300 px.

jQuery('p').css('line-height', '1.8em');
Apply a line-height of 1.8em to all paragraphs.

jQuery('li:odd').css({color: 'white', backgroundColor: 'black'});
Apply two CSS rules to every other list item; note that the css() function can take an object instead of two strings.

jQuery('a[@href^="http://"]').addClass('external').attr('target', '_blank');
Add a class of “external” to all external links (those beginning with http://), then add target=“_blank” for good measure. This makes use of chaining, described below.

jQuery('blockquote').each(function(el) { alert(jQuery(this).text()) });
Iterate over every blockquote on the page, and alert its textual content (excluding HTML tags).

jQuery('a').html('Click here!');
Replace all link text on the page with the insidious “Click here!”.




|| Thema: JQuery || Titel: JQuery - Select Elements ||
|| Beitrag erstellt von: develop am 30. Juli ||

JQuery - Select Elements

jQuery('div.panel')
All divs with class=“panel”

jQuery('p#intro')
The paragraph with id=“intro”

jQuery('div#content a:visible')
All visible links inside the div with id=“content”

jQuery('input[@name=email]')
All input fields with name=“email”

jQuery('table.orders tr:odd')
“odd” numbered rows in a table with class “orders”

jQuery('a[@href^="http://"]')
All external links (links that start with http://)

jQuery('p[a]')
All paragraphs that contain one or more links




|| Thema: JQuery || Titel: JQuery - Toggle Effekt integrieren ||
|| Beitrag erstellt von: develop am 29. Juli ||

JQuery - Toggle Effekt integrieren

nach der JQuery Einbindung in das HTML Dokument

<**script> // ohne **

$(document).ready(function(){
$("#divid1").click(function () {
$("#divid2").slideToggle("slow");
});
});

<**/script> // ohne **


In diesem Fall reagiert der Browser auf einen Klick in das Element mit Div-Id1 und slided damit die zweite DIV-Id2 ein und aus.




|| Thema: JQuery || Titel: JQuery einbinden (im HeadTag) ||
|| Beitrag erstellt von: develop am 29. Juli ||

JQuery einbinden (im HeadTag)

Lokal

<**script type="text/javascript" src="jquery.js"> <**/script>// ohne **

Online Version

<**script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"><** /script>// ohne **

Download
jquery.com