Click here to Skip to main content
15,889,116 members
Home / Discussions / Web Development
   

Web Development

 
QuestionHow to sync database offline and online application Pin
Arvind Zamakia25-Mar-16 22:17
Arvind Zamakia25-Mar-16 22:17 
AnswerRe: How to sync database offline and online application Pin
ZurdoDev28-Mar-16 8:37
professionalZurdoDev28-Mar-16 8:37 
AnswerRe: How to sync database offline and online application Pin
Afzaal Ahmad Zeeshan28-Mar-16 9:50
professionalAfzaal Ahmad Zeeshan28-Mar-16 9:50 
QuestionUnitOfWork And Repository Patterns Not Needed When Using EF Pin
MadDashCoder24-Mar-16 8:34
MadDashCoder24-Mar-16 8:34 
AnswerRe: UnitOfWork And Repository Patterns Not Needed When Using EF Pin
Richard Deeming24-Mar-16 9:13
mveRichard Deeming24-Mar-16 9:13 
QuestionSOMEONE HELP ME FIX THIS. URGENT! Pin
EdzMedallada21-Mar-16 8:33
EdzMedallada21-Mar-16 8:33 
AnswerRe: SOMEONE HELP ME FIX THIS. URGENT! Pin
Serkan Onat21-Mar-16 11:43
professionalSerkan Onat21-Mar-16 11:43 
QuestionDeselecting An Element When Another Element is Selected Pin
MadDashCoder20-Mar-16 21:19
MadDashCoder20-Mar-16 21:19 
I have a table with a couple rows. Ech row has a class of either black or blue. Black rows have black background, blue rows have blue background. Currently when the cursor hovers over any row, its background turns purple.

When the mouse cursor leaves a row, its background reverts back to what it was.

The functionality that I cannot get to work is when a new row is clicked. When a new row is clicked I would like the background of the old row which was previously clicked to revert back to its original color.

I want the clicked row to remain gray until another row is clicked or when the cursor hovers over it but it is not working.
CSS
<style>
        body { font-family: San-Serif; color:white;}
        table { border-collapse: collapse;}
        th { text-align: left; }
        tr.black { background-color: black; }
        tr.blue { background-color:blue;}        
</style>

CSS
<style>
  .markedBlack, .markedBlue{background:gray}       
</style>

HTML
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script>

JavaScript
<script>
    $(document).ready(function() {
       $("tbody tr").mouseover(function() {   
           $(this).css("background","purple"); 
       });
 
       $(".black").mouseout(function() {      
          $(this).css("background","black"); 
       });

       $(".blue").mouseout(function() {      
          $(this).css("background","blue");         
       });
 
       $(".black").click(function(){              
           $(this).removeClass("black").addClass("markedBlack");           
       });

       $(".blue").click(function(){   
           $(this.blue").removeClass("blue").addClass("markedBlue");           
       });

       $(".markedBlack").click(function(){                 
              $(".markedBlack").removeClass("markedBlack").addClass("black"); 
           $(this).addClass("markedBlack");                     
       });

       $(".markedBlue").click(function(){             
              $(".markedBlue").removeClass("markedBlue").addClass("blue");  
           $(this).addClass("markedBlue");         
       });
     });   

</script>

HTML
<table>
    <thead>
        <tr>
          <th>Title1</th><th>Title2</th><th>Title3</th>
        </tr>
    </thead>
    <tbody>
        <tr class="blue">
          <td>blue</td> <td>blue</td> <td>blue</td>
        </tr>
        <tr class="black">
          <td>black</td> <td>black</td> <td>black</td>
        </tr>
        <tr class="blue">
          <td>blue</td> <td>blue</td> <td>blue</td>
        </tr>
        <tr class="black">
          <td>black</td> <td>black</td> <td>black</td>
        </tr>
    </tbody>
</table>


modified 21-Mar-16 15:56pm.

AnswerRe: Deselecting An Element When Another Element is Selected Pin
Richard Deeming21-Mar-16 3:22
mveRichard Deeming21-Mar-16 3:22 
GeneralRe: Deselecting An Element When Another Element is Selected Pin
MadDashCoder21-Mar-16 7:49
MadDashCoder21-Mar-16 7:49 
GeneralRe: Deselecting An Element When Another Element is Selected Pin
Richard Deeming21-Mar-16 9:57
mveRichard Deeming21-Mar-16 9:57 
QuestionCan the Prestashop Layered Navigation Block work in Localhost? Pin
Andre HS19-Mar-16 4:20
Andre HS19-Mar-16 4:20 
QuestionDiscount Coupons/Deals site Pin
Riya k Sharma17-Mar-16 7:54
Riya k Sharma17-Mar-16 7:54 
AnswerRe: Discount Coupons/Deals site Pin
Goyllo11-Apr-16 2:31
Goyllo11-Apr-16 2:31 
Questionweb servirce url consume Pin
caradri15-Mar-16 4:09
caradri15-Mar-16 4:09 
GeneralRe: web servirce url consume Pin
Nathan Minier16-Mar-16 2:20
professionalNathan Minier16-Mar-16 2:20 
GeneralRe: web servirce url consume Pin
caradri16-Mar-16 3:08
caradri16-Mar-16 3:08 
AnswerRe: web servirce url consume Pin
caradri16-Mar-16 22:20
caradri16-Mar-16 22:20 
QuestionHow to group 3 form fields into one using bootstrap 3 Pin
Emad Hassan Khan13-Mar-16 1:14
Emad Hassan Khan13-Mar-16 1:14 
AnswerRe: How to group 3 form fields into one using bootstrap 3 Pin
Emad Hassan Khan13-Mar-16 1:37
Emad Hassan Khan13-Mar-16 1:37 
QuestionSending SMS Task Pin
Member 1238760712-Mar-16 7:02
Member 1238760712-Mar-16 7:02 
AnswerRe: Sending SMS Task Pin
Richard MacCutchan13-Mar-16 0:11
mveRichard MacCutchan13-Mar-16 0:11 
QuestionMvc5 or MVC plugin Architecture Pin
Member 1114105611-Mar-16 0:41
Member 1114105611-Mar-16 0:41 
AnswerRe: Mvc5 or MVC plugin Architecture Pin
Nathan Minier11-Mar-16 1:40
professionalNathan Minier11-Mar-16 1:40 
GeneralRe: Mvc5 or MVC plugin Architecture Pin
Member 1114105611-Mar-16 2:23
Member 1114105611-Mar-16 2:23 

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.