Monday, 22 December 2014

Modifying Child theme CSS

/*
Theme Name: Spacious Child Theme
Theme URI: http://themegrill.com/themes/spacious/
Description: Spacious Child Theme
Author: ThemeGrill
Author URI: http://themegrill.com
Template: spacious
Version: 1.0
*/
@import url("../spacious/style.css");

/* =Theme customization starts here
------------------------------------------------------- */
#site-title a {
color: #0000FF;
font-size: 42px;
}

Child Theme Making Import CSS

/*
Theme Name: Spacious Child Theme
Theme URI: http://themegrill.com/themes/spacious/
Description: Spacious Child Theme
Author: ThemeGrill
Author URI: http://themegrill.com
Template: spacious
Version: 1.0
*/
@import url("../spacious/style.css");

/* =Theme customization starts here  


Points to remember:

  • Template name (here in this case spacious) should match the folder name of the parent theme and also make sure there are no blank space after the name.
  • In the line @import url("../spacious/style.css"); the word spacious should also match the folder name of the parent theme.
  • Other details can be added or changed as you like.

Sunday, 21 December 2014

JavaScript Page Leave Message

<script type="text/javascript">
 window.onbeforeunload = function(){
    return "Are you sure you wanna leave my site?";
}
</script>


Disable submit button -

document.getElementById('button_id').onsubmit = function() { return false; }

Thursday, 18 December 2014

jQuery select one radio at one time with different name tested on local

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  <script type="text/javascript">
 
 $(document).ready(function(){
 $('#choice_46_0').click(function () {


  if ($('#choice_46_0').is(':checked'))
   {
   $('#choice_49_0').attr('checked', false);
   }
 
  });
  $('#choice_49_0').click(function () {


  if ($('#choice_49_0').is(':checked'))
   {
   $('#choice_46_0').attr('checked', false);
   }
 
  });
  alert("Hi");

 });

 </script>

Wednesday, 17 December 2014

Selects only one Radio Button at A time. no one way possible.

/*
Selects only one Radio Button at A time. no one way possible.
if using different names..
and we cannot apply onclick event on input

$(document).on('pageinit', function () {
    $(document).on('change', '[type=radio]', function (e) {
        $('[type=radio]:checked').prop('checked', false).checkboxradio('refresh');
        $(this).prop('checked', true).checkboxradio('refresh');
    });
});



<tr><td class=m>Check In<input type="checkbox" name="_fid_28" onclick="document.qdbform._fid_29.checked=false;"</td>

<tr><td class=m>Check Out<input type="checkbox" name="_fid_29" onclick="document.qdbform._fid_28.checked=false;"</td>
*/

Tuesday, 16 December 2014

Jquery 2 sliders conflicting each other

use this code at the end of first slider script -- --tested ok

$ = jQuery.noConflict(true);





other options are --

 
Try wrapping your code like this:

(function($){

    $(document).ready(function(){
         //document ready code here
    });

})(jQuery);

Monday, 15 December 2014

What you can do is pass the variable from outside that .js file, like this

<div class="row">
    <div class="small-12 columns">
        page content
    </div>
</div>
<script>var test = '<?php echo $variable; ?>';</script>