Click here to Skip to main content
15,891,749 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
Hera is my code

Click on it

So , How to change my style of title . Because its just appear in yellow back ground. and I want to show it bold and red and if possible That when i clicked the text then appear it. and after 5 second its finished.
Posted
Comments
Not clear and does not make a question at all. Please improve.

1 solution

There is no clear idea is given on the scenario on which you want a scenario, but still i have tried to give one solution as per my understanding of your question.

What i understand you have a title and you wan to appear a style for the title on click of it, and after 5 seconds it will disappear automatically.
So let say your title is a span with ID = 'spanTitle' as below :
HTML
<span id="spanTitle">Sample Title</span>


We have a css class which will apply font style as you want like below :-
CSS
.headerStyle{
    font-weight:bold;
    color:red;    
}


Now here is the jQuery code which will set the style for it on click of it, also it will automatically be normal after 5 secs.
Ex :-

JavaScript
$(document).ready(function(){
    $('#spanTitle').click(function(){
        $('#spanTitle').addClass('headerStyle');
        setTimeout(function(){change_style();},5000);
    });    
});

function change_style(){
    $('#spanTitle').removeClass('headerStyle');
}



Hope this is the exact solution what you are looking for and what i understood your question, if not can you please elaborate your question a bit more ?
 
Share this answer
 
Comments
Amir khan gopang 26-May-14 17:03pm    
@smrutis1984 Its nice try But My Question is that. when I clicked on my Font then Appear A title and and font always still. The title is appear. Just for 5 sec.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900