Link to home
Start Free TrialLog in
Avatar of newbie27
newbie27Flag for United Kingdom of Great Britain and Northern Ireland

asked on

jQuery Image opacity

Hello Experts,
I am making an icon on the page to look pale by reducing its opacity when the user clicks on it.
something like this
$(this).animate({opacity: "0.3"}, 500);
It is working fine on the event, however it is not retaining its style when I refresh the page.
Can someone please let me know If we can do quick jQuery search if the Id of this icon exist in the menu where it has been added then keep the pale look. Please can someone advice how to check this?
Thanks for your help.
Regards
S
Avatar of newbie27
newbie27
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER



function retainImageSyle(){	
	
	$('.addToShortList').each( function(){ 
											var myId = $(this).attr('id');
											var theId = myId.replace('_lnk', '');
											//alert(theId);
											
											var myList = getShortList();
											for(var x=0; x<myList.length; x++)
											{
												if( myList[x].id == theId){												
													$(this).animate({opacity: "0.3"}, 500);  												
												}
											}
												
											} 
							);
	 
}	
 

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks hielo
Hielo,

I think I have managed to do this, please below solution here

https://www.experts-exchange.com/questions/23529998/showing-the-newly-added-in-the-drop-down-list.html

please also see if this makes sense?

thanks

PRIVATE FUNCTION WriteListsDropdown()
 Dim bound      
    sFilename = "test@test.com.xml"      
    sXMLFile = ADMIN_WWW_FOLDER & "\lists\data\" & sFilename        
       
    Set fso = Server.CreateObject("Scripting.FileSystemObject")
        If fso.FileExists(sXMLFile) Then
                Set oFile = fso.OpenTextFile(sXMLFile)
                xmlData = oFile.ReadAll
                        'response.write xmlData
                xmlListName = split(XMLField(xmlData, "listname", False), chr(28))                                
                        on error resume next                        
                        bound = UBound(xmlListName)
                        For i = 0 To bound                        
                              If i = bound Then
                                    WriteListsDropdown = WriteListsDropdown & "<OPTION value=""" & xmlListName(i) & """" & " selected>" & xmlListName(i) & "</OPTION>"
                              Else
                                    WriteListsDropdown = WriteListsDropdown & "<OPTION value=""" & xmlListName(i) & """" & ">" & xmlListName(i) & "</OPTION>"
                                    
                              End If
                        Next
        End If
    If request.cookies("shortlist") <> "" Then
            WriteListsDropdown = WriteListsDropdown & "<OPTION value=""shortlist"">ShortList</OPTION>"
      End If         
      WriteListsDropdown = WriteListsDropdown & "<OPTION value=""new"">New List...</OPTION>"       

END FUNCTION
>>I think I have managed to do this, please below solution here

I meant to say, copy the above and paste it here

https://www.experts-exchange.com/questions/23529998/showing-the-newly-added-in-the-drop-down-list.html