Pages

Saturday, January 14, 2017

Smooth Scroll for menu in Onepage site

Smooth Scroll for Onepage site


$(function() {
   $('ul li a[href*="#"]:not([href="#"])').click(function() {
   if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
     var target = $(this.hash);
     target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
     if($(window).width()>=768){
       if (target.length) {
         $('html, body').animate({
           scrollTop: target.offset().top - 90
         }, 800);
         return false;
       }
     }
     else{
       if (target.length) {
         $('html, body').animate({
           scrollTop: target.offset().top - 50
         }, 800);
         return false;
       }
     }
   }
   });
 });

Thursday, January 12, 2017

Add Facebook Widget in HTML Website

How are Add Facebook widget Timeline OR Posts in your website

Example here:
Just Change the name of your path in the href attribute like:

href="https%3A%2F%2Fwww.facebook.com%2Fyourpagename

<iframe src="https://www.facebook.com/plugins/page.php?href=https%3A%2F%2Fwww.facebook.com%2Ffacebook&tabs=timeline&width=340&height=500&small_header=false&adapt_container_width=true&hide_cover=false&show_facepile=false&appId=524468484230981" width="340" height="300" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>


View Posts of your page.



Add Twitter Widget in HTML Website

Add Twitter Widget in HTML Website


<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
                                <a class="twitter-timeline" href="https://twitter.com/zakeerio">Tweets by Zahid Ali Keerio</a>
                                <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

Example: 

Tuesday, January 3, 2017

Create Helper function in CodeIgniter

Create Helper function in Codeigniter
------------------------------------------------------------------------
if(!function_exists('sqlRecordsCount')){
function sqlRecordsCount(){
$ci1 =& get_instance();

           // Get Connection of Another Database Defined

   $db2 = $ci1->load->database('otherdb', TRUE);
 

            $query = "SELECT book_id from books";
$query = $db2->query($query);

// echo $db2->last_query();
$result = $query->result_array();
return $result;

}

}

print_r($sqlRecordsCount());