Javascript help

Snappy

^^^^UpHosting^^^^
Aug 29, 2013
521
43
nw3Du20.png

Can someone tell me how I can get it so that when they click the cross the welcome message disappears??
 

Snappy

^^^^UpHosting^^^^
Aug 29, 2013
521
43
As I have barely any experience with javascript could you tell me which bits I would input with my data?
HTML:
<div class="Welcome">Welcome to HabGlobe, We are a new Habbo fansite and hope to become an official one!
<img src="images/Actions-file-close-icon.png" width="16" height="16" alt=""/></div>
That is my html
 

Weasel

👄 I'd intercept me
Nov 25, 2011
4,142
2,468
Not sure, but try this:
Code:
$(".close").on("click",
    function()
    {
        $('.welcome').hide("slow", function(){ $('.welcome').remove(); });
    }
);

And make the image this:
Code:
<img src="images/Actions-file-close-icon.png" width="16" height="16" class="close" alt=""/>
 

Snappy

^^^^UpHosting^^^^
Aug 29, 2013
521
43
Not sure, but try this:
Code:
$(".close").on("click",
    function()
    {
        $('.welcome').hide("slow", function(){ $('.welcome').remove(); });
    }
);

And make the image this:
Code:
<img src="images/Actions-file-close-icon.png" width="16" height="16" class="close" alt=""/>
It doesn't work for some reason.
 

Weasel

👄 I'd intercept me
Nov 25, 2011
4,142
2,468
What does your console show?
Add this line under the {, refresh the page, open the console, click on the action and check if it submits the message in the console log.
Code:
console.log("Test");
 

Users who are viewing this thread

Top