• Follow me on:

Thursday, December 5, 2019

How to reset animated GIF image?


Recently I was working for a UI, where I was using GIF image for some interaction. On document load GIF image starts animating, when we switch to different tabs and again back to this tab containing the animated gif image, but when I return to this tab the gif "starts" at a point somewhere in the middle.

 I was looking for the solution of restarting the gif animation. Best solution I found is reloading the image by resetting the image "src".   JQuery code for reloading the image with id = #gifImage

<img src="anim.gif" id="gifImage" />

JQuery:
jQuery('#gifImage').removeAttr('src','');

Removing the attribute of the image again displaying the image on action whenever needed will restart the gif from beginning.


  Share Your Solutions

Wednesday, August 28, 2019

How to hard reload or refresh in chrome browser for Android


You can use the Request Desktop Site option from the app menu (to the right of the address bar).
Page will reload immediately. Now u can simply click on it, wait for the refresh. Again go to the same menu and deselect Desktop Site option.

Saturday, June 8, 2019

Credit Card Input field, with space every 4 characters using Jquery


Here is a simple way to create an input field for Credit Cards.  Credit card input fields were made in 4 different text fields to get the entries from the user.  Which used to jump over to next input field automatically.  But this code accepts numbers in a single input field with a space after every 4 characters.  Simple Jquery is used to solve the problem.  On every keypress in the focussed input field the action is initiated.

HTML for the input field

<input class="field" id="credit-card" value="" autocomplete="off" type="text" />


Jquery

<script>
jQuery(document).ready(function() {
  $('#credit-card').on('keypress change', function () {

  $(this).val(function (index, value) {
  return value.replace(/\W/gi, '').replace(/(.{4})/g, '$1 ');
  });
});

});
</script>





Friday, April 26, 2019

How to change the PHP version on my website?

Recently I had a problem with a project.  I created a website using wordpress and upgraded the hosting server to latest version 7.2.  But other websites on this same hosting stop working.  These other websites were pretty old and created in PHP version 5.6.  It was showing HTTP Error 500.  In cPanel there is an option to upgrade PHP version.  But single PHP version is allowed for single cPanel.

Change the PHP version through cPanel


1. Login to cPanel. Scroll down to Software section and click on "Select PHP Version".  Next window select from the dropdown selection on top.


Change the PHP version using .htaccess file

Open .htaccess file through ftp or cpanel.  Some times its not visible in cPanel.  You can make them visible, view following article "How to show hidden files in cPanel?"

Edit .htaccess file in the root folder.  Add the following code and run.

AddHandler fcgid-script .php 
FCGIWrapper "/dh/cgi-system/php72.cgi" .php

Above code forces PHP to switch to 7.2 version.

Though this code was tested, if this doesn't work or causes any problem remove the lines and switch back to previous version. 


Share Your Solutions

How to show hidden files in cPanel

Very often we face this problem when few files specially (.) dot files are not visible in cPanel.  When we access them though FileZilla or WinSCP they are visible in the directory.  To make them visible go through following steps.

Login to cPanel, Click "File Manager" in Files section.

Complete directory will appear on the screen.  Click on Settings and check the option "Show hidden files" and Save 

Now you can see your hidden files listed in the same directory.



Share Your Solutions

Thursday, March 28, 2019

Kibber

Kibber is a village at an altitude of 4270m, (14,200ft) in Spiti valley of Lahaul Spiti district in Himachal Pradesh, India.  Kibber is famous for its Ki monastery and Kibber wildlife sanctuary.  Located at 19kms from Kaza connected by bus and local cab service only in summers.

Kibber has a civil dispensary, a high school, and a post office. Kibber Monastery was founded by Serkang Rimpochhe of Tabo.

Post office, Kibber


Kibber wildlife sanctuary is only sanctuary in a cold desert, home for  many important species of medicinal plants, ibex, blue sheep, red fox, lynx, pika and the snow leopard.




In recent years kibber has become centre of attraction for many geologists.  Also titled as Fossils Park is home for different Fossils. 



Fossils

Fossils


Ki Monastery is considered one of the most important Buddhist pilgrimage in Spiti Valley located close to Kibber enroute Kaza.  Ancient murals, thangkas (paintings on cotton or silk), rare manuscripts, and wind instruments are preserved here in this Monastery.

Ki Monastery


Still now barter system is followed for trade between locals and Ladakhis.  Horses are often traded for yaks.  Agriculture and animal husbandry is major occupation here.


High altitude and pollution free atmosphere make it a favourite destination for sky gazers and nature lovers.  The Mount Kanamo is very famous amongst trekkers and mountaineers.  It is one of the very few marching peaks in Himalayas with altitude around 6000m.







Temperature in winters is around -10 degree celsius forcing people to stay indoors.  Food is stocked for survival in winters and spend there time knitting clothes and creating handcrafted items.
There is only one water source coming somewhere from the springs of high mountains, properly pipelined upto the village, but during winters frozen spring compels them to do a lot of hardwork for arranging water.

How to reach?
Kibber is 19kms from Kaza, one of the biggest village or we can say town in Spiti Valley.  From Kaza there is only one bus towards Kibber.   Best option is to hire a taxi from Kaza.  Kaza is accessible both from Shimla and Manali.  From Shimla it is 430kms and from Manali it is 210 kms via Rohtang and Kunzum Pass.

Stay at Kibber: Homestay is the only option here, no hotels or resorts are available.  Locals provide rooms for rents on very affordable price with yummy food.

Tuesday, March 26, 2019

Disable previous dates from jquery date picker

Sometimes you want users to select dates after current day, usually required in appointment or meeting applications. But these date pickers are provided with all dates active.  Following few lines can disable past dates from the current date on a datepicker.


This will set today's date as start date on page load itself and disable all the previous dates.

// Getter
var minDate = $( "#datepicker" ).datepicker( "option", "minDate" );
// Setter
$( "#datepicker" ).datepicker( "option", "minDate", new Date() );

In case you want to disable dates past some specific date in place of new Date(), we can use any string specifying Date in a format specified by us to set current date as minimum date. e.g:


$('#datetimepicker1').data("DateTimePicker").minDate("03/26/2018");

Share your solutions

Sunday, March 17, 2019

Batal


Batal village is at an altitude of 3960m with two small road side eateries Chacha-Chachi n Kangri Dhaba offering basic Indian meals. Famous Chandratal lake is accessible on foot from Batal. Batal comes under Spiti part of the Lahul and Spiti district of Himachal Pradesh, India.

Bus journey from Manali to Kaza via Rohtang and Kunzum is best to experience the scenic beauty of Spiti valley. Bus service on this route depends on weather conditions. This route is accessible when Rohtang and Kunzum pass opens. Only one Himachal roadways bus runs on this route. 0530hrs it starts from Manali and 10 - 12 hours drive to reach Kaza. Batal is often considered as stop for lunch. High altitude desert landscape with virtually no civilisation is a treat for eyes.




Mighty mountains of Pir Panjal and Spiti ranges dominates the beautiful landscape of Batal. There is an alternate route from Shimla side from Kinmaur valley. One must plan a overnight stay preferably at Reckong Peo before reaching Kaza. And again from Kaza there is only one bus towards Manali of Himachal Roadways via Kunzum and Rohtang pass which leaves Kaza around 0530 hrs. Foreign visitors need inner line permit to travel on this route. Losar is checkpost point while coming from Manali to Kaza. Indians have to carry their valid identity proofs.
All Rights Reserved Jaydharphics Click To Mail Me (+91 9564 5592 84)