Exercises
To complete these exercises, you will need the index.html
file for this chapter, as well as the finished JavaScript code as found in complete.js
. These files can be downloaded from the Packt Publishing website at http://www.packtpub.com/support.
The challenge exercises may require use of the official jQuery documentation at http://api.jquery.com/.
Create new plugin methods called
.slideFadeIn()
and.slideFadeOut()
, combining the opacity animations of.fadeIn()
and.fadeOut()
with the height animations of.slideDown()
and.slideUp()
.Extend the customizability of the
.shadow()
method so that the z-index of the cloned copies can be specified by the plugin user. Add a new sub-method calledisOpen
to the tooltip widget. This sub-method should returntrue
if the tooltip is currently displayed andfalse
otherwise.Add code that listens for the
tooltipopen
event that our widget fires, and logs a message to the console.Challenge: Provide an alternative
content
option for the tooltip widget...