HI,
My code to expand an item on click and collapse on click is not working in the mobile view. It works how I want in the desktop view though. Any reason for this?
You’ll have to show us a screenshot/video and code.
No problem, I will get that for you
Here is the code:
// For full API documentation, including code examples, visit Velo API Reference - Wix.com
$w.onReady( function () {
});
//User can click the drop down arrow to display the reviews adn the closing arrow
export function CRArrow_click(event) {
if ($w(‘#Review’).collapsed) {
$w(‘#Review’).expand();
}
else
$w(‘#Review’).collapse();
if ($w(‘#CRArrowClose’).collapsed) {
$w(‘#CRArrowClose’).expand();
}
else
$w(‘#CRArrowClose’).collapse();
}
//User can click the Client Review Title to display the reviews
export function clientReviews_click(event) {
if ($w(‘#Review’).collapsed) {
$w(‘#Review’).expand();
}
else
$w(‘#Review’).collapse();
if ($w(‘#CRArrowClose’).collapsed) {
$w(‘#CRArrowClose’).expand();
}
else
$w(‘#CRArrowClose’).collapse();
}
//When the reviews expand, collapse the open arrow and the title
export function Review_viewportEnter(event) {
$w(‘#clientReviewsTitle’).collapse();
$w(‘#CRArrowOpen’).collapse();
}
//When the reviews collapse, expand the open arrow and the title so that it can be opened again
export function Review_viewportLeave(event) {
$w(‘#clientReviewsTitle’).expand();
$w(‘#CRArrowOpen’).expand();
}
//Closing arrow to close the reveiws and reveal the title and opening arrow again
export function CRArrow2_click(event) {
if ($w(‘#Review’).expand) {
$w(‘#Review’).collapse();
}
else
$w(‘#Review’).expand();
if ($w(‘#CRArrowClose’).collapsed) {
$w(‘#CRArrowClose’).expand();
}
else
$w(‘#CRArrowClose’).collapse();
}
//Closing image to close the reveiws and reveal the title and opening arrow again
export function CRImage_click(event) {
if ($w(‘#Review’).expand) {
$w(‘#Review’).collapse();
}
else
$w(‘#Review’).expand();
if ($w(‘#CRArrowClose’).collapsed) {
$w(‘#CRArrowClose’).expand();
}
else
$w(‘#CRArrowClose’).collapse();
}
Here is the website page. It looks funky just because I don’t plan on leaving it that way, but when you click the Client Reviews Title or the arrow it opens up the reviews and the close arrow. The mobile site doesnt open the reviews up
Also, its at the bottom of the page to the left
I just saw your website, it’s fantastic! How did you code such a neat and responsive header ? (search bar, menu…)