Hi Israel, @yisrael-wix
I used your code. But I still have not been able to solve to the end.
My site has a “Studies” page - which can also be accessed from the “Studies” top menu. And also in the fourth strip entitled “Studies” from the home page.
But on the “Studies” page itself, I divided it into “Courses” and “Workshops” by 2 buttons on the page that are above the slider that changes according to the click. (And also in their color)
Now, in the home page on the “Studies” strip, I also divided it into 2 “Workshops” and “Courses” boxes, and each box has a dedicated button that should lead to the “Studies” page into the correct slider. (“Courses” / “Workshops”)
So I made your code, but my problem now is that the “Studies” page in this top menu goes to the “Workshops” slide (sometimes, depending on whether you already clicked on the “Workshops” button on the home page)
In addition, according to the buttons on the “Studies” page (above the slider) it is on “Courses” (the button appears in pink)
I would really, really appreciate it if you could help me solve the code.
It will really save me in front of the customer.
Website link:
https://www.art-meaning.com/
Link to study page:
https://www.art-meaning.com/studies
A photograph of the “Studies” strip on the home page, which is divided into 2 boxes:
The code I have on the home page (where the buttons are on the strip):
$w . onReady ( function () {
// Write your JavaScript here
// To select an element by ID use: $w('#elementID')
// Click 'Preview' to run your code
});
import wixLocation from ‘wix-location’ ;
import { local } from ‘wix-storage’ ;
$w . onReady ( function () {
$w ( “#button25” ). onClick (( event ) => {
console . log ( ‘click’ );
local . setItem ( “slide-number” , “1” );
wixLocation . to ( “/studies#fullWidthSlides1” );
})
});
$w . onReady ( function () {
$w ( “#button6” ). onClick (( event ) => {
console . log ( ‘click’ );
local . setItem ( “slide-number” , “0” );
wixLocation . to ( “/studies#fullWidthSlides1” );
})
});
The code on the “Studies” page (where the slider is with the extra buttons above it):
$w . onReady ( function () {
//TODO: write your page related code here…
});
export function secondButton_click ( event , $w ) {
$w ( “#fullWidthSlides1” ). changeSlide ( 1 );
$w ( “#secondButton” ). style . backgroundColor = “#B7B7DB” ;
let bgColor = $w ( “#secondButton” ). style . backgroundColor ;
$w ( “#secondButton” ). style . color = “#DE6BB9” ;
$w ( “#firstButton” ). style . backgroundColor = “#003C3C” ;
$w ( “#firstButton” ). style . color = “#B7B7DB” ;
$w ( “#thirdButton” ). style . backgroundColor = “#003C3C” ;
$w ( “#thirdButton” ). style . color = “#B7B7DB” ;
}
export function firstButton_click ( event , $w ) {
$w ( “#fullWidthSlides1” ). changeSlide ( 0 );
$w ( “#firstButton” ). style . backgroundColor = “#B7B7DB” ;
let bgColor = $w ( “#firstButton” ). style . backgroundColor ;
$w ( “#firstButton” ). style . color = “#DE6BB9” ;
$w ( “#secondButton” ). style . backgroundColor = “#003C3C” ;
$w ( “#secondButton” ). style . color = “#B7B7DB” ;
$w ( “#thirdButton” ). style . backgroundColor = “#003C3C” ;
$w ( “#thirdButton” ). style . color = “#B7B7DB” ;
}
export function thirdButton_click ( event , $w ) {
$w ( “#fullWidthSlides1” ). changeSlide ( 2 );
$w ( “#thirdButton” ). style . backgroundColor = “#B7B7DB” ;
let bgColor = $w ( “#thirdButton” ). style . backgroundColor ;
$w ( “#thirdButton” ). style . color = “#DE6BB9” ;
$w ( “#firstButton” ). style . backgroundColor = “#003C3C” ;
$w ( “#firstButton” ). style . color = “#B7B7DB” ;
$w ( “#secondButton” ). style . backgroundColor = “#003C3C” ;
$w ( “#secondButton” ). style . color = “#B7B7DB” ;
}
export function downButtonDay2_click ( event , $w ) {
$w ( “#fullWidthSlides1” ). changeSlide ( 1 );
}
export function downButtonDay1_click ( event , $w ) {
$w ( “#fullWidthSlides1” ). changeSlide ( 0 );
}
import { local } from ‘wix-storage’ ;
$w . onReady ( function () {
let num = Number ( local . getItem ( “slide-number” ));
$w ( “#fullWidthSlides1” ). changeSlide ( num );
});