Sabtu, 16 Juli 2011

jQuery ColorBox popup

Akhirnya punya waktu juga nge share tutorial jQuery, berhubung bulan ini aku magang jadi gak begitu banyak nge buka blog hehe... di tutorial ini saya akan memberikan trik tentang jQuery ColorBox popup yang gak kalah menarik untuk di coba, masih ingat kan tentang tutorial saya sebelumnya yaitu membuat popup modal jQuery yang sempat menjadi post populer di blog saya. Di tutorial ini saya akan memberikan tutorial popup jQuery dengan tiga jenis kamu bisa lihat contoh pertamanya di blog demo jaya. contoh kedua dan ketiga akan segera menyusul. Sudah melihatnya dan ingin memasangnya di blog kamu ikuti langkah langkah pembuatannya dibawah ini

* Langkah pertama masuk ke blogger lalu pergi ke Rancangan dan Edit HTML
* Tekan F3 pada keyboard dan cari kode <head> letakan kode jQuery dibawah ini dibwah kode<head>

    <link href='https://sites.google.com/site/shofisanjaya/colorboxwhite/colorbox.css' media='screen' rel='stylesheet'/>
    <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js'/>

    <script src='https://sites.google.com/site/shofisanjaya/colorboxwhite/jquery.colorbox.js'/>
    <script>
        $(document).ready(function(){
            //Examples of how to assign the ColorBox event to elements
            $(&quot;a[rel=&#39;example1&#39;]&quot;).colorbox();
            $(&quot;a[rel=&#39;example2&#39;]&quot;).colorbox({transition:&quot;fade&quot;});
            $(&quot;a[rel=&#39;example3&#39;]&quot;).colorbox({transition:&quot;none&quot;, width:&quot;75%&quot;, height:&quot;75%&quot;});
            $(&quot;a[rel=&#39;example4&#39;]&quot;).colorbox({slideshow:true});
            $(&quot;.example5&quot;).colorbox();
            $(&quot;.example6&quot;).colorbox({iframe:true, innerWidth:425, innerHeight:344});
            $(&quot;.example7&quot;).colorbox({width:&quot;80%&quot;, height:&quot;80%&quot;, iframe:true});
            $(&quot;.example8&quot;).colorbox({width:&quot;50%&quot;, inline:true, href:&quot;#inline_example1&quot;});
            $(&quot;.example9&quot;).colorbox({
                onOpen:function(){ alert(&#39;onOpen: colorbox is about to open&#39;); },
                onLoad:function(){ alert(&#39;onLoad: colorbox has started to load the targeted content&#39;); },
                onComplete:function(){ alert(&#39;onComplete: colorbox has displayed the loaded content&#39;); },
                onCleanup:function(){ alert(&#39;onCleanup: colorbox has begun the close process&#39;); },
                onClosed:function(){ alert(&#39;onClosed: colorbox has completely closed&#39;); }
            });
           
            //Example of preserving a JavaScript event for inline calls.
            $(&quot;#click&quot;).click(function(){
                $(&#39;#click&#39;).css({&quot;background-color&quot;:&quot;#f00&quot;, &quot;color&quot;:&quot;#fff&quot;, &quot;cursor&quot;:&quot;inherit&quot;}).text(&quot;Open this window again and this message will still be here.&quot;);
                return false;
            });
        });
    </script>

* Simpan template kamu dan buat satu post untuk membuat popupnya, copy dan paste kan kode HTML dibawah ini didalam kolom posting kamu

<a class="example8" href="#">Contoh jQuery ColorBox popup</a>
<div style="display: none;">

<div id="inline_example1" style="background: none repeat scroll 0% 0% rgb(255, 255, 255); padding: 10px;">
<b>jQuery ColorBox popup</b>
Ini adalah contoh jQuery ColorBox popup, kamu bisa membuat jQuery popup ini dengan mudah dan bisa langsung dipasang pada blog kamu by shofisanjaya.

</div>
</div>

* Terbitkan Entri dan lihat hasilnya kamu bisa mengeditnya sesuai keinginan dibwah ini kamu bisa lihat contohnya

Contoh 1 jQuery ColorBox popup

jQuery ColorBox popup 1
Ini adalah contoh jQuery ColorBox popup, kamu bisa membuat jQuery popup ini dengan mudah dan bisa langsung dipasang pada blog kamu by shofisanjaya.


Contoh 2 jQuery ColorBox popup

jQuery ColorBox popup 2
Ini adalah contoh jQuery ColorBox popup, kamu bisa membuat jQuery popup ini dengan mudah dan bisa langsung dipasang pada blog kamu by shofisanjaya.