Click here to Skip to main content
15,896,453 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: javascript doesn't work with FORM tag Pin
williamroma2-May-12 1:44
williamroma2-May-12 1:44 
AnswerRe: javascript doesn't work with FORM tag Pin
Peter_in_27802-May-12 12:53
professionalPeter_in_27802-May-12 12:53 
QuestionJquery Notification Navigation Pin
Billa223-Apr-12 16:31
Billa223-Apr-12 16:31 
AnswerRe: Jquery Notification Navigation Pin
ZurdoDev25-May-12 9:00
professionalZurdoDev25-May-12 9:00 
Questiongenerated HTML calling javascript functions Pin
KingDidd20-Apr-12 8:01
KingDidd20-Apr-12 8:01 
AnswerRe: generated HTML calling javascript functions Pin
Benaiah Mischenko24-Apr-12 23:26
Benaiah Mischenko24-Apr-12 23:26 
QuestionComet hints Pin
mehrdadc4817-Apr-12 21:11
mehrdadc4817-Apr-12 21:11 
QuestionCode does't work on a MVC partial view rendering Pin
Kenneth McCoy11-Apr-12 7:36
professionalKenneth McCoy11-Apr-12 7:36 
The following code works as intended when a page is loaded with the defined elements, but does not if it is to be called on a MVC partial view rendering. I understand why it doesn’t is because the page has already loaded but the elements this code acts on has not been loaded.

I have tried referencing the source of the code in partial view .ascx file and have also tried loading the code within script tags: these do not work.

Any help on how I can get this to work on a partial view/page update would be appreciated.

Sliding.js

JavaScript
// This is a reduced accordian effect on div class hideableItem elements.
$(document).ready(function () {
    $('.itemHeader').click(function () {
        // Get the parent of the item that was previously clicked.
        var priorSelectedParent = $('.itemHeaderSelected').parent().attr('id');
        $('#' + priorSelectedParent + ' .hideableItem').slideUp('fast');
        $('#' + priorSelectedParent + ' .itemHeaderSelected').addClass('itemHeader');
        $('#' + priorSelectedParent + ' .itemHeader').removeClass('itemHeaderSelected');
        // Get the parent of the item that was clicked.
        var headerParent = $(this).parent().attr('id');
        $('#' + headerParent + ' .hideableItem').slideDown('slow');
        $('#' + headerParent + ' .itemHeader').addClass('itemHeaderSelected cornersRoundSmall');
        $('#' + headerParent + ' .itemHeaderSelected').removeClass('itemHeader');
    })
});

// On pages that utilize the accordian effect this causes the div class openingHeader
// to open after the page loads.
$(document).ready(function () {
    $('.hideableItem').hide();
    // Needed to add a slight time delay before triggering the click event.
    setTimeout(function () {
        // Select the 'Summary' section be open after the page loads.
        $('.openingHeader').trigger('click');
    }, 10);
});


Thank you,

Ken
AnswerRe: Code does't work on a MVC partial view rendering Pin
Kenneth McCoy12-Apr-12 6:46
professionalKenneth McCoy12-Apr-12 6:46 
Questionhow to detect upload dialog closing? Pin
Ali Al Omairi(Abu AlHassan)9-Apr-12 4:58
professionalAli Al Omairi(Abu AlHassan)9-Apr-12 4:58 
AnswerRe: how to detect upload dialog closing? Pin
Mohibur Rashid15-Apr-12 19:17
professionalMohibur Rashid15-Apr-12 19:17 
QuestionUse getElementById without request to server Pin
Christi50007-Apr-12 22:05
Christi50007-Apr-12 22:05 
AnswerRe: Use getElementById without request to server Pin
Ali Al Omairi(Abu AlHassan)8-Apr-12 3:11
professionalAli Al Omairi(Abu AlHassan)8-Apr-12 3:11 
GeneralRe: Use getElementById without request to server Pin
Christi50008-Apr-12 6:12
Christi50008-Apr-12 6:12 
GeneralRe: Use getElementById without request to server Pin
Ali Al Omairi(Abu AlHassan)9-Apr-12 2:39
professionalAli Al Omairi(Abu AlHassan)9-Apr-12 2:39 
GeneralRe: Use getElementById without request to server Pin
Christi50009-Apr-12 5:05
Christi50009-Apr-12 5:05 
GeneralRe: Use getElementById without request to server Pin
Ali Al Omairi(Abu AlHassan)11-Apr-12 0:18
professionalAli Al Omairi(Abu AlHassan)11-Apr-12 0:18 
GeneralRe: Use getElementById without request to server Pin
RichardGrimmer11-Apr-12 5:31
RichardGrimmer11-Apr-12 5:31 
GeneralRe: Use getElementById without request to server Pin
Ali Al Omairi(Abu AlHassan)11-Apr-12 6:01
professionalAli Al Omairi(Abu AlHassan)11-Apr-12 6:01 
GeneralRe: Use getElementById without request to server Pin
RichardGrimmer11-Apr-12 21:30
RichardGrimmer11-Apr-12 21:30 
GeneralRe: Use getElementById without request to server Pin
Ali Al Omairi(Abu AlHassan)12-Apr-12 5:19
professionalAli Al Omairi(Abu AlHassan)12-Apr-12 5:19 
AnswerRe: Use getElementById without request to server Pin
Angel13209-Apr-12 20:53
Angel13209-Apr-12 20:53 
QuestionJavascript Pin
Manikandan H4-Apr-12 21:02
Manikandan H4-Apr-12 21:02 
AnswerRe: Javascript Pin
ZurdoDev12-Apr-12 8:58
professionalZurdoDev12-Apr-12 8:58 
QuestionHow to find the row in the gridview that was selected Pin
MacIntyre4-Apr-12 13:24
MacIntyre4-Apr-12 13:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.