Ok, sorry if I am misunderstanding, or misinterpreting, anything, but I am fairly new to jQuery and javascript.
I have built a shop in php, and one of the elements is a jQuery cart that is 'required' in all pages so its always on page. The jQuery I include on page to make it work is as follows:
$(document).ready(function(){
$("#cbox").hover(function(){
$(this).stop(true,false)
.animate({right: 0}, 500); },
function(){
$("#cbox").stop(true,false).animate({right: -120}, 500); });
});
Basically the cart sits on the right side of the page, and on hover pops/slides out.
I would like to make it programmatically pop/slide out when the user adds an item to the basket, as a sort of notification of the event. Ideally using onclick
.
I have tried calling various parts, but as its a on document ready overall function, I am struggling as to what my onclick
should say. Am am not even sure if it will work.
Can anyone give me a point in the right direction please?