top of page

Forum Posts

nevs
Jan 05, 2021
In Coding with Velo
Hi, I have been using wix for 3/4 years now. Over that time, I have seen a few improvements, but my site is really lagging behind what it should be (image compression in use etc). Google Page Speed Insights: Mobile Score = 8 Desktop = 21 What code is possible via Velo/Corvid to increase page speeds? I already have page caching features on with large periods of time. Can you defer offscreen images / lazy loading images via Velo? I have images on the home screen that don't need to load straight away i.e. images at bottom of page. Does anyone know of any other Velo code to optimise page speed?
Velo Speed up Page times / Slow Pagespeed Insights content media
0
1
57
nevs
Jan 29, 2020
In Coding with Velo
Hi, I am using sendgrid api V3 to send an email on form submission as seen here at: https://www.vorbly.com/Vorbly-Code/WIX-SENDGRID-API-V3---AUTO-EMAIL-MESSAGES I would like to send one email to myself and another email to the forms email contact field. However, I want to use two seperate email bodies, so send two seperate emails on form submission. The problem I have is that the first email sends OK, but the second doesnt because it says sendformData already declared const body already declared cont subject already declared How can I code it so that the two seperate emails can send? //send email on form submit code import {sendEmail, sendEmailWithRecipient} from 'backend/email'; $w.onReady(function () { $w("#MYDATABASE").onAfterSave(sendFormData); }); // Customize Your Email to yourself - EMAIL 1 // function sendFormData() { const subject = `SUBJECT`; const body =`EMAIL BODY`; sendEmail(subject, body) .then(response => console.log(response)); // Customize Your Email to person completing the form EMAIL 2// function sendFormData() { const subject = `SUBJECT`; const body =`EMAIL BODY`; const recipient = $w("#EMAILFORMVALUE").value; sendEmailWithRecipient(subject, body, recipient) .then(response => console.log(response)); }} My email.jsw is: import { sendWithService } from 'backend/sendGrid'; export function sendEmail(subject, body) { const key = "HIDDEN"; // Replace with your API key // const sender = "HIDDEN"; // Sender email // const recipient = "HIDDEN"; // Notification to yourself // return sendWithService(key, sender, recipient, subject, body); } export function sendEmailWithRecipient(subject, body, recipient) { const key = "HIDDEN"; // Replace with your API key // const sender = "HIDDEN"; // Sender email // return sendWithService(key, sender, recipient, subject, body); // Customer email // }
0
3
103
nevs
Jan 23, 2020
In Coding with Velo
Hi, I have a form that is a bundle of user inputs connected to a dataset and a submit button that connects to, so not using the wix form app. If I go to dashboard, automation, and select form, my custom form is not listed as choice to setup automation? How can I use automation with a custom form? does this have to be with corvid?
0
1
52
nevs
Jan 22, 2020
In Coding with Velo
Hi, I have searched this forum but having a problem adding text strings together to sum them together and get a total. so I am using: var a = parseFloat($w("#text1").value); var b = parseFloat($w("#text2").value) var totalprice = a + b $w("#totalprice").value = totalprice; } the text1 and text2 value are currency strings using .toLocaleString('en', { style: 'currency', currency: 'GBP' }) If I change code to: var a = $w("#text1").value; var b = $w("#text2").value; var totalprice = a + b $w("#totalprice").value = totalprice; } I get them adding as strings like £100£200 etc Any ideas? Thanks
0
3
358
nevs
Jan 22, 2020
In Coding with Velo
Hi, I want to do something like below, but not quite sure on the code. So if any of text 1,2,3,4,5,6 has a yes value, then show the boxes... Any ideas? $w.onReady(function() { if ($w('#text1').value === 'Yes'); or($w('#text2').value === 'Yes'), or($w('#text3').value === 'Yes'), or($w('#text4').value === 'Yes'), or($w('#text5').value === 'Yes'), or($w('#tex6').value === 'Yes'), $w('#box1').expand(), $w('#box2').expand(), $w('#box3').expand(), $w('#box4').expand();
0
1
24
nevs
Jan 21, 2020
In Coding with Velo
Hi, I am looking to make a price calculator that looks up the users drop down value selection against a database and returns a price back in a text element box. I have three elements: #dropdown1 - yes/no #dropdown2 - text strings #slider1 - a number #subinviteprice - text box for final price to display in When dropdown1 = Yes, dropdown2 appears, when the user selects an option, it should perform the data query, and lookup the price based on the value in slider1 and if that lies between quantityfrom and quantityto fields. It also lookups in "product" field the value specified of "invitations". It then should update #subinviteprice. Any ideas why it doesn't work? Thank you. import { wixData } from 'wix-data'; export function dropdown1_change(event) { if ($w('#dropdown1').value === 'Yes') $w('#dropdown2').expand(); else $w('#dropdown2').collapse(); } export function dropdown2_change_1(event) { wixData.query("Pricing") .eq("Product", "Invitations") .eq("Printing", $w("#dropdown2").value) .lt("Quantityto", $w("#slider1").value) .gt("Quantityfrom", $w("#slider1").value) .find() .then((results) => { let items = results.items; let item = items[0]; let quotePrice = item.Price; console.log(quotePrice); $w("#subinviteprice").text = "quotePrice"; }); }
0
5
381
nevs
Jan 13, 2020
In Coding with Velo
Hi, I want to change the colour of the text on mouse in and mouse out. The font style is saved in paragraph 3 theme, and I use additional letter spacing of 0.1. The code below works fine, however, on some occasions, the mouse out doesn't execute properly (i.e. it glitches and the colour doesn't revert back even though the mouse is out of the element). Please note the element mouse out action is defined in the properties. Code I am using is below, any ideas to optimise the code or something I am doing wrong? export function text2_mouseIn(event, $w) {$w("#text2").html = '<p class="font_9"><span style="color:#BAA59B;"><span style="letter-spacing:0.1em;">' + $w("#text2").text + '</span></span></p>'} export function text2_mouseOut(event, $w) {$w("#text2").html = '<p class="font_9"><span style="color:#414141;"><span style="letter-spacing:0.1em;">' + $w("#text2").text +'</span></span></p>'} Alternatively if anyone knows how to customise a wix button so that the text can include character spacing then that might solve it and I can use a wix button! Thank you.
0
11
320
nevs
Jan 10, 2020
In Coding with Velo
Hi, I want to change the font colour inside text box elements on mouse in and mouse out etc. Is there a way of specifying multiple text box element ids and changing them all in the same function or do you have to code for each and every element (repeat over and over again)? I.e. have to repeat this code below again and again...or is there a better way if dealing with multiple text boxes? $w.onReady(function () { $w('#text1').onMouseIn(()=>{hoverTxt();}); $w('#text1').onMouseOut(()=>{unhoverText();}); }); function hoverTxt(){ let oldHtmlStr = $w('#text1').html; let newHtmlStr = oldHtmlStr.replace(/#E0760D/i, '#402858'); console.log(newHtmlStr); $w('#text1').html = newHtmlStr; } function unhoverText(){ let oldHtmlStr = $w('#text1').html; let newHtmlStr = oldHtmlStr.replace(/#402858/i, '#E0760D'); console.log(newHtmlStr); $w('#text1').html = newHtmlStr;
0
1
128
nevs
Dec 10, 2019
In Coding with Velo
Does anyone know why if you make a box container to show on all pages why when you click the layers button, it doesnt appear to hide the box on that page? It means if you want to work on content behind the box container, you have to go back to box container, click show on all pages as of, then go back use layers and hide it, then do it all in reverse to put it back. Also any event handler settings for the container get reset! Wix really dont make things logical...
0
1
107
nevs
Dec 09, 2019
In Coding with Velo
Hi, I have a wix light box that triggers when a text box element is hovered over. The problem I have is I also want that textbox element to link to another page when clicked on. When the user puts the mouse over the text box element, the lightbox loads, and when the textbox element is clicked on, nothing happens. I cant get the textbox element that I use to link to another page. Is this because once the lightbox is loaded, effectively this element falls outside the lightbox and therefore cant be clicked? I have set the element properties so that it loads the functions. Site Code: import wixLocation from "wix-location"; import window from 'wix-window'; export function menulink_mouseIn(event) {window.openLightbox('Menu1');} export function menulink_click(event) {wixLocation.to("/anotherpage")} lightbox page code: import wixWindow from 'wix-window'; import wixLocation from 'wix-location'; export function lightboxmenu1_mouseOut(event) {wixWindow.lightbox.close();} export function menulink_click(event){wixWindow.lightbox.close();wixLocation.to("/anotherpage"); } Any ideas? Thank you!
0
2
390
nevs
Dec 06, 2019
In Coding with Velo
Hi, I have made a mega menu on wix so that if someone hovers over a text box in my page header as a way of a page navigation bar, it shows a box container. i.e. from image below, if you hover over text box menu link 1, it displays container box menu 1. If you hover over text box menu link 2, it displays container box menu 2. The website/code works fine in preview/live, however, as the box container is at the top of my page and is used as menu, it overlaps all my other content in the editor mode (in preview mode, the container box is hidden). This is annoying when editing my website. Is there anyway to hide elements on the actual editor? or alternatively can I make a box container that appears on all pages, but can be edited on just one page and link it by code? Also if I have two box containers located in the same position as per below, you cant work with them.
Hide Box Containers in Editor  content media
0
3
844
nevs
Nov 19, 2018
In Coding with Velo
Hi, When you first click to load the wix store, you get a purple spinning wheel. Is there anyway to customise the colour of this spinning wheel before it loads the Wix store page? Thank you.
0
1
1k
nevs
Aug 01, 2018
In Coding with Velo
Hi, I would like to add to my wix site a calendar date picker whereby a user selects a date. Depending on the date selected, text to appear which then appears below: "This needs to be done by DD/MM/YY [6 months before date selected]" "This should to be done by DD/MM/YY [3 months before date selected]" "This should to be done by DD/MM/YY [1 month before date selected]" The date in the text being a pre-determined setting of months/days before the date selected which I would choose/set. Thank you for your suggestions / thoughts.
0
7
367

nevs

More actions
bottom of page