<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aman Beg on Medium]]></title>
        <description><![CDATA[Stories by Aman Beg on Medium]]></description>
        <link>https://medium.com/@aman-beg?source=rss-ba7296da0129------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Z1UEre6WZ-ehAhR3gfZWTA.jpeg</url>
            <title>Stories by Aman Beg on Medium</title>
            <link>https://medium.com/@aman-beg?source=rss-ba7296da0129------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 03:41:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aman-beg/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[jQuery Owl Carousel on dynamically added items]]></title>
            <link>https://aman-beg.medium.com/jquery-owl-carousel-on-dynamically-added-items-ce4ef709409c?source=rss-ba7296da0129------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce4ef709409c</guid>
            <category><![CDATA[laravel-5]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[laravel-framework]]></category>
            <category><![CDATA[laravel-tips-and-tricks]]></category>
            <category><![CDATA[laravel-development]]></category>
            <dc:creator><![CDATA[Aman Beg]]></dc:creator>
            <pubDate>Thu, 17 Jul 2025 19:18:20 GMT</pubDate>
            <atom:updated>2025-07-17T19:36:15.133Z</atom:updated>
            <content:encoded><![CDATA[<p>Today I was stuck to initialise Owl Carousel on div whose items were added dynamically after an Ajax call.</p><p>Then I noticed that it was not working because I had added the initialisation code globally. So it was initialising on an empty div and then I added items dynamically. therefore I destroyed Owl Carousel and reinitialised it.</p><pre>const $carousel = $(&#39;#productCarousel&#39;);</pre><pre>// Destroy old instance if exists<br><br>if ($carousel.hasClass(&#39;owl-loaded&#39;)){</pre><pre>$carousel.trigger(&#39;destroy.owl.carousel&#39;); </pre><pre>$carousel.html(productHtml); // Re-apply content<br><br>});</pre><pre>// Now init OwlCarousel<br><br>$carousel.owlcarousel({<br><br>loop: false, </pre><pre>margin: 10, </pre><pre>nav: true, </pre><pre>dots: false, </pre><pre>responsive: {</pre><pre>    0: {items: 1}, </pre><pre>    600: {items: 2},<br><br>    1000: {items: 4}<br><br>}</pre><pre>});</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce4ef709409c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>