On Mon, Jun 1, 2009 at 8:51 AM, madhatter <h...@ix.de> wrote:
>
> Hi there,
>
> for an introductory article regarding jQuery I have done the obvious
> and shown how to do a slide show of pictures (nothing as fancy as
> lightbox :-). The application consists of 1 HTML, 1 JavaScript and one
> PHP file.
>
> Provided, I include
>
>        <div id="liste">
>           <ul id="fuerbildernum"><span class="bildervorsatz">Bilder</span>

This markup is not good. You shouldn't have anything directly inside
UL except LI. Doing this may cause unexpected results.


>             <li><a title="Bild 1 von 9 [hafen]" href="images/hafen1.jpg">1</
> a></li>
>               ...
>             <li><a title="Bild 9 von 9 [hafen]" href="images/hafen9.jpg">9</
> a></li>
>           </ul>
>        </div>
>
> in the HTML file it starts working just fine. But then I want to
> change this list and have the a element of the picture in question
> removed. Which means I change the div "liste" in order to have it look
> like
>
>       ...
>        <li><a title="Bild 3 von 9 [hafen]" href="images/hafen3.jpg">3</a></
> li>
>        <li>4</li>
>        <li><a title="Bild 5 von 9 [hafen]" href="images/hafen5.jpg">5</a></
> li>
>      ...
>
> After having generated this list a click on one of the links only has
> the effect of switching to the image's page.

Can you clarify this? Do you have some code that removes the A tag?


> Does this mean that jQuery can not access a "generated" element (that
> was not part of the original HTML file)? In other words, do functions
> like $.getJSON() not access generated code?
>
> The JavaScript code that generates the new links inside the ul element
> looks like this
>
>      for (i = 1; i <= bdaten.serienlaenge; i++) {
>        if (i != bdaten.bildnr) {
>          listentext += '\n\t<li><a title="Bild ' + i + ' von ' +
> laenge + ' [' + serie + ']" href="images/hafen' + i  + '.jpg">' + i +
> '</a></li>';
>        } else {
>          listentext += '\n\t<li>' + i + '</li>';
>        }
>      }


I don't see any click handler there. Please post all of the relevant code.

Reply via email to