Highlights a selector to a given color (blue by default) when events occurs.
This is common to see text highlighting when there are no save button on a form, this text highlighting
graphically tells the user that a change has been taken into account. Put a selector inside data-highlight
to highlight it when the event occurs.
If you want to highlight different selectors according to events, you can use data-highlight-(event), and they
will be used if this event occurs.
.animate()
method needs jquery ui to process colors.
This form looks like this:
<input type="button" value="Click me" class="btn domajax click" data-lock="" data-endpoint="highlight-basics-handler.php" data-highlight="" /> <br/><br/> <input id="hello" type="text" placeholder="Edit me" class="btn domajax keyup" data-endpoint="highlight-basics-handler.php" data-lock="" data-highlight="#hello" data-highlight-color="red" />
This form looks like this:
<div id="input"> <label for="fruit">Enter a fruit</label> <input type="text" id="fruit" class="btn domajax keyup" data-endpoint="highlight-saving-handler.php" data-input="#input" data-output="#output" data-highlight="" /> <br/><br/> <label for="vegetable">Enter a vegetable</label> <input type="text" id="vegetable" class="btn domajax keyup" data-endpoint="highlight-saving-handler.php" data-input="#input" data-output="#output" data-highlight="" /> </div> <div id="output"></div>
This form looks like this:
<div id="inputs"> Do you want the server to send a 500 error (so the ajax call will fail)? <br/><br/> <input type="radio" name="want_error" value="yes"/> Yes <input type="radio" name="want_error" value="no" checked/> No <br/><br/> <input type="button" value="Go" class="btn domajax click" data-endpoint="highlight-succerror-handler.php" data-input="#inputs" data-highlight-success="#success" data-highlight-failure="#failure" /> <br/><br/> <div id="success">This text will be highlighted if the ajax call succeed</div> <div id="failure">This text will be highlighted if the ajax call fails</div> </div>
All the documentation at a glance