Deprecated: Assigning the return value of new by reference is deprecated in /membri/echoweb/wp-settings.php on line 520

Deprecated: Assigning the return value of new by reference is deprecated in /membri/echoweb/wp-settings.php on line 535

Deprecated: Assigning the return value of new by reference is deprecated in /membri/echoweb/wp-settings.php on line 542

Deprecated: Assigning the return value of new by reference is deprecated in /membri/echoweb/wp-settings.php on line 578

Deprecated: Function set_magic_quotes_runtime() is deprecated in /membri/echoweb/wp-settings.php on line 18

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl(&$output) in /membri/echoweb/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl(&$output) in /membri/echoweb/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el(&$output) in /membri/echoweb/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el(&$output) in /membri/echoweb/wp-includes/classes.php on line 1199

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el(&$output) in /membri/echoweb/wp-includes/classes.php on line 1244

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl(&$output) in /membri/echoweb/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl(&$output) in /membri/echoweb/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el(&$output) in /membri/echoweb/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el(&$output) in /membri/echoweb/wp-includes/classes.php on line 1391

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el(&$output) in /membri/echoweb/wp-includes/classes.php on line 1442

Strict Standards: Redefining already defined constructor for class wpdb in /membri/echoweb/wp-includes/wp-db.php on line 306

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /membri/echoweb/wp-includes/cache.php on line 431

Strict Standards: Declaration of Walker_Comment::start_lvl() should be compatible with Walker::start_lvl(&$output) in /membri/echoweb/wp-includes/comment-template.php on line 1266

Strict Standards: Declaration of Walker_Comment::end_lvl() should be compatible with Walker::end_lvl(&$output) in /membri/echoweb/wp-includes/comment-template.php on line 1266

Strict Standards: Declaration of Walker_Comment::start_el() should be compatible with Walker::start_el(&$output) in /membri/echoweb/wp-includes/comment-template.php on line 1266

Strict Standards: Declaration of Walker_Comment::end_el() should be compatible with Walker::end_el(&$output) in /membri/echoweb/wp-includes/comment-template.php on line 1266

Strict Standards: Redefining already defined constructor for class WP_Dependencies in /membri/echoweb/wp-includes/class.wp-dependencies.php on line 31

Strict Standards: Redefining already defined constructor for class WP_Http in /membri/echoweb/wp-includes/http.php on line 61

Strict Standards: Non-static method K2::init() should not be called statically in /membri/echoweb/wp-content/themes/k2/functions.php on line 31

Strict Standards: Non-static method K2::register_scripts() should not be called statically in /membri/echoweb/wp-content/themes/k2/app/classes/k2.php on line 51

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method K2Options::init() should not be called statically in /membri/echoweb/wp-includes/plugin.php on line 339

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method K2Header::init() should not be called statically in /membri/echoweb/wp-includes/plugin.php on line 339

Strict Standards: Non-static method K2Header::get_header_width() should not be called statically in /membri/echoweb/wp-content/themes/k2/app/classes/header.php on line 8

Warning: Cannot modify header information - headers already sent by (output started at /membri/echoweb/wp-includes/class.wp-dependencies.php:31) in /membri/echoweb/wp-content/plugins/wassup/wassup.php on line 1434

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method K2::filter_post_comments() should not be called statically in /membri/echoweb/wp-includes/plugin.php on line 166
Tag Archive for ‘jquery’ at ECHOWEB
Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method K2Header::output_header_css() should not be called statically in /membri/echoweb/wp-includes/plugin.php on line 339

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method K2Header::output_header_css() should not be called statically in /membri/echoweb/wp-includes/plugin.php on line 339

Tag Archive for 'jquery'

JQuery Plugin: inserire delle informazioni sui campi input

Di seguito vi allego il mio primo plugin in JQuery.
Questo plugin riempie determinati campi input di tipo “text”, con delle informazioni.
Quando l’utente clicca sul campo, il contenuto scompare.
Se l’utente lascia vuoto il campo, in automatico viene riempito con l’informazione di default.

Ecco come usare il plugin.

Step 1: richiamo script e foglio di stile associati al plugin

<link rel="stylesheet" href="preset.jquery.css" type="text/css" media="all" />
<script type="text/javascript" src="preset.jquery.js"></script>

Step 2: richiamo la funzione del plugin sui campi che voglio

<script>
$(function () {  
	$('#txtName').preset({"preset":"Nome","myclass":"red"});
	$('#txtSurname').preset({"preset":"Cognome"});
	$('#txtCity').preset({"preset":"Città"});
}); 
</script>

La pagina si presenterà così:

<!DOCTYPE>
<html>
<head>
 
<script src="http://code.jquery.com/jquery-latest.js"></script>
<link rel="stylesheet" href="http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css" type="text/css" media="all" />
 
<link rel="stylesheet" href="preset.jquery.css" type="text/css" media="all" />
<script type="text/javascript" src="preset.jquery.js"></script>
 
<script>
$(function () {  
	$('#txtName').preset({"preset":"Nome","myclass":"red"});
	$('#txtSurname').preset({"preset":"Cognome"});
	$('#txtCity').preset({"preset":"Città"});
}); 
</script>
</head>
<body>
 
<h1>JQuery Plugin: Preset</h1>
 
<input type='text' id='txtName'  /><br >
<input type='text' id='txtSurname'  /><br >
<input type='text' id='txtCity'  /><br ><br >
 
</body>
</html>

Come si usa il Plugin

$('#objId').preset({
	"preset":"Nome", // il testo che si vuole far apparire nel campo input, quando questo è vuoto
	"myclass":"red"  // la classe da usare, per la scritta di preset (dipende dal file css)
});

Demo
Download Plugin
Download Css