capt_nemo777
03-08-2010, 10:48 AM
hi, I don't really know what's going on, am just starting to learn jquery.
in my practice code, the "back to top" link doesn't appear.
here's my html code
<div class="chapter">
<p class="square">Our Professional Men and Gentlemen are
Squares (to which class I myself belong) and Five-Sided
Figures or <a
href="http://en.wikipedia.org/wiki/Pentagon">Pentagons
</a>.
</p>
<p class="nobility hexagon">Next above these come the
Nobility, of whom there are several degrees, beginning at
Six-Sided Figures, or <a
href="http://en.wikipedia.org/wiki/Hexagon">Hexagons</a>,
and from thence rising in the number of their sides till
they receive the honourable title of <a
href="http://en.wikipedia.org/wiki/Polygon">Polygonal</a>,
or many-Sided. Finally when the number of the sides
becomes so numerous, and the sides themselves so small,
that the figure cannot be distinguished from a <a
href="http://en.wikipedia.org/wiki/Circle">circle</a>, he
is included in the Circular or Priestly order; and this is
the highest class of all.
</p>
and here's the jquery code
$(document).ready(function(){
$('<a href="#top">back to top</a>')
.insertAfter('div.chapter p');
$('<a id="top" name="top"></a>')
.prependTo('body');
});
when i ran the script, no "back to top" link after each paragraph appear :confused:
in my practice code, the "back to top" link doesn't appear.
here's my html code
<div class="chapter">
<p class="square">Our Professional Men and Gentlemen are
Squares (to which class I myself belong) and Five-Sided
Figures or <a
href="http://en.wikipedia.org/wiki/Pentagon">Pentagons
</a>.
</p>
<p class="nobility hexagon">Next above these come the
Nobility, of whom there are several degrees, beginning at
Six-Sided Figures, or <a
href="http://en.wikipedia.org/wiki/Hexagon">Hexagons</a>,
and from thence rising in the number of their sides till
they receive the honourable title of <a
href="http://en.wikipedia.org/wiki/Polygon">Polygonal</a>,
or many-Sided. Finally when the number of the sides
becomes so numerous, and the sides themselves so small,
that the figure cannot be distinguished from a <a
href="http://en.wikipedia.org/wiki/Circle">circle</a>, he
is included in the Circular or Priestly order; and this is
the highest class of all.
</p>
and here's the jquery code
$(document).ready(function(){
$('<a href="#top">back to top</a>')
.insertAfter('div.chapter p');
$('<a id="top" name="top"></a>')
.prependTo('body');
});
when i ran the script, no "back to top" link after each paragraph appear :confused: