Plugin Directory

Changeset 647655


Ignore:
Timestamp:
01/04/2013 12:19:24 AM (13 years ago)
Author:
bgentry
Message:

Updating faqmaker.js to improve IE compatibility

Location:
easy-faq-with-expanding-text
Files:
15 added
3 edited

Legend:

Unmodified
Added
Removed
  • easy-faq-with-expanding-text/trunk/faq.php

    r640889 r647655  
    33Plugin Name: Easy FAQ with Expanding Text
    44Description: Easily create a Frequently Asked Questions page with answers that slide down when the questions are clicked. No need for a shortcode, HTML coding, or javascript tweaking.
    5 Version: 3.1
     5Version: 3.1.5
    66Author: bgentry
    77Author URI: http://bryangentry.us
  • easy-faq-with-expanding-text/trunk/faqmaker.js

    r640915 r647655  
    11function bgfaq(foldup) {
    2         jQuery('.bg_faq_content_section :header:not(h6)').each(function(){
    3             //containsimg = jQuery(this).getElementsByTagName('img');
    4             //if ( !containsimg )
    5             jQuery(this).addClass('bg_faq_closed');
    6             jQuery(this).nextUntil(':header').css({'display':'none'});
    7             var textsize = jQuery(this).css('font-size');
     2        jQuery('.bg_faq_content_section :header:not(h6)').each(function(){ // select all the heading in .bg_faq_content_section other than h6
     3            jQuery(this).addClass('bg_faq_closed');                     //make these heading "closed"
     4            jQuery(this).nextUntil(':header').css({'display':'none'});  //hide everything up until the next heading
     5            var textsize = jQuery(this).css('font-size');               //get the font size in order to more accurately position the visual cue
    86            var halftextsize = parseInt(textsize)/2;
    97            var backgroundpos = Math.round(halftextsize)-10;
    10             var padding = jQuery(this).css('padding-top');
     8            var padding = jQuery(this).css('padding-top');              //get the padding in order to help us position the visual cue
    119            var padding = parseInt(padding);
    1210            var backgroundpos = Math.round(halftextsize)-10+padding;
    13             jQuery(this).css({'background-position-y': backgroundpos});
    14             console.log(textsize);
     11            jQuery(this).css({'background-position-y': backgroundpos}); //position the visual cue
     12           
    1513        jQuery(this).click(function(){
    16        
    17             if(jQuery(this).hasClass('bg_faq_opened')) {
    18                 jQuery(this).nextUntil(':header').slideUp();
     14                                                                        //whenever one of these headings is clicked,
     15            if(jQuery(this).hasClass('bg_faq_opened')) {                //check to see if it's opened. If so,...
     16                jQuery(this).nextUntil(':header').slideUp();            //slide up the content beneath it and mark this heading "closed"
    1917                jQuery(this).removeClass('bg_faq_opened').addClass('bg_faq_closed');
    20                 }
    21         else {
    22         if(foldup=='yes') {
    23             jQuery('.bg_faq_opened').each(function(){
    24                 jQuery(this).nextUntil(':header').slideUp();
     18                }                                                       
     19        else {                                                          //if it isn't opened,
     20        if(foldup=='yes') {                                             //check to see we are supposed to fold up other content so only one answer shows at a time.
     21            jQuery('.bg_faq_opened').each(function(){                   //if so...
     22                jQuery(this).nextUntil(':header').slideUp();            //foldup other content and mark the headings as closed
    2523                jQuery(this).removeClass('bg_faq_opened').addClass('bg_faq_closed');
    2624            })
    2725        }
    28         jQuery(this).nextUntil(':header').slideDown();
     26        jQuery(this).nextUntil(':header').slideDown();                  //then roll out the content and mark the heading as opened
    2927        jQuery(this).removeClass('bg_faq_closed').addClass('bg_faq_opened');
    3028        }
  • easy-faq-with-expanding-text/trunk/readme.txt

    r640889 r647655  
    44Tags: faq pages
    55Tested up to: 3.5
    6 Stable tag: 3.1
     6Stable tag: 3.1.5
    77License: GPLv2
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2323
    2424== Changelog ==
     25
     26= 3.1.5 =
     27Improved compability with Internet Explorer by removing a line of javascript that was not needed.
    2528
    2629= 3.1 =
Note: See TracChangeset for help on using the changeset viewer.