Skip to content

A problem with including var and conditional functions in the function #571

@emoz41

Description

@emoz41

Hi

JQuery version: 3.5.1

I have a simple problem: I cannot put var and conditional functions in the function of this library

My code:

` $("#change-color-04").spectrum({

	type:"color",														
	
	showButtons: false,													
	
	showAlpha: false,											
	
	allowEmpty: false,													
	
	showInput: true,													
	
	palette: [ ],														
	
	showSelectionPalette: false,										
	
	selectionPalette: ["#d8dee3", "#232830","#363e45","#739921"],		
	
	///////////////////////////////////
	
	checkOptionSelect 	= $("p").filter("#theme-manager-theme-list-result").text()		
	
	checkOption01		= $("p").find("#option-change-themes-01").text()		
	
	checkOption02		= $("p").find("#option-change-themes-02").text()	
	
	if( checkOptionSelect === checkOption01 )
	{
		move: function(color) {
			
			$("div").filter("#change-color-04").css("background-color",color.toHexString())	
			
			$("p,h2").filter("#texts-fontcolor").css("color",color.toHexString())
			
			$("span").filter(".data-theme-manager-theme-01-texts-color").text( color.toHexString() ) 
		}
		
		return
	}
	
	if( checkOptionSelect === checkOption02 )
	{
		move: function(color) {
			
			$("div").filter("#change-color-04").css("background-color",color.toHexString())	
			
			$("p,h2").filter("#texts-fontcolor").css("color",color.toHexString())
			
			$("span").filter(".data-theme-manager-theme-02-texts-color").text( color.toHexString() )
		}
		
		return
	}
});`

what's the problem ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions