1

I'm new to jQuery but a friend recommended to use it for this.

I want to load banners dynamiclly from another location into an advertisement box. I have made it cycle though the banners with this.

$(document).ready(function() {
    $('.banner').cycle({
        fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    });
});

That works fine, but the links still have to be within the html file, I want to be able to edit a single file and it will update the banners on all them templates.

Any help?

4

1 に答える 1

0

このようなもの。

$(document).ready(function() {
    $('.banner').load('banner.html').cycle({
        fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    });
});

http://api.jquery.com/load/をご覧ください。

于 2013-02-04T00:06:27.400 に答える