- Screen name: deuxk17
deuxk17's Profile
3 Posts
12 Responses
0
Followers
Show:
- Expanded view
- List view
Private Message
- Hi,
I want to change an expand / collapse feature that existed on my site, I would like a simple and similar operation, but for now I get nothing.
Before it is a picture that I change the name of the current source, I would do exactly the same thing but that alternates the background-image.
Here is my current code and the code comment is that before, I would arrive at the same thing in a similar way:- $.fn.expandCollapse = function() {
$(this).click(function(){
$(this).parent().find('.content').slideToggle("fast");
$(this).find('span').css('background-image', function(i, src) {
return (src.indexOf('expand.png') != -1)? 'tpl/images/collapse.png' :'tpl/images/expand.png';
});
/*
$(this).find('img').attr('src',function(i,src){
return (src.indexOf('expand.png') != -1)? 'tpl/images/collapse.png' :'tpl/images/expand.png';
}); */
});
};
Thank
- 10-Feb-2014 12:57 PM
- Forum: Developing jQuery Plugins
Hello,
I customized my alert but I have a little problem with the functioning. I want to use the ESC and ENTER key to close the alert. It is functional, the problem is if I press ESC / ENTER the alert will close it if I re-press the ESC opens it again. I would close only once the alert, the ESC / ENTER key is no longer functional. I try to include the function unbind or off and nothing gives the result expected.
I show you my code and if you see what I did wrong please sign made me!var t = $('#PopAlert');
if(content.length) $('div#Content', t).html(content);
Pop(t, function() {
$('.x',t).off('click').on('click',function(e) {
e.preventDefault();
showPop(t);
return false;
});$('.ok',t).off('click').click(function (e) {
e.preventDefault();
showPop(t);
if(typeof cb == 'function'){ cb.call(this); }
return false ;
});$(document).keypress(function(e) {
if(e.keyCode==13) { $('.ok', t).trigger('click'); }
if(e.keyCode==27) { $('.x', t).trigger('click'); }
});
});
};
- Hi,
I want to show div after all function are execute... I check if cookie have a number of a menu search and i make it.. i want to hide this search menu, when the animate are finish i want to show it... I use animate, because after the loading it's animate change...
i try this but not working :
$('.search').hide();
if($.cookie("searchStyle")==1) {
resultResize2(685,'fast');
$('#expandMap').hide();
$('#collapseMap').show();
}
if($.cookie("searchStyle")==2) {
resultResize(264,'fast');
mapResize(430,'fast');
$('#expandMap').show();
$('#collapseMap').hide();
}
if($.cookie("searchStyle")==3) {
mapResize(0,'fast');
resultResize(685,'fast');
$('#expandResult').hide();
$('#expandMap2').show();
$('#collapseResult').show();
}
$('.search').show();
do you have idea?? i try a lot of think but alway the same result.
thank- «Prev
- Next »
- $.fn.expandCollapse = function() {
Moderate user : deuxk17
© 2013 jQuery Foundation
Sponsored by and others.

