Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search

Search the Community

Showing results for tags 'javascript'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Forum
    • News and Announcements
    • Getting Started With Squarespace
    • Coding and Customization
    • Commerce
    • Feedback on Your Site
    • Images and Videos
    • Pages and Content
    • SEO and Marketing
    • Site Design and Styles

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Website


Location

Found 79 results

  1. I have a weird issue whenever I try to use the innerHTML function in an embedded block. The function does not seem to work properly when multiple blocks are embedded on the same page. Multiple blocks all display the same image even if the code is different. I don't believe this is a coding issue on my end because if I replace innerHTML with textContent, the data pulls correctly. Anyone else have this issue? Images have been attached for clarity. This is the exact same JS, but one uses getElementByID('element').textContent, and the other uses getElementByID('element').innerHTML You can see that the textcontent pull has different data while the innerHTML returns identical data.
  2. Does anybody know how to do a header like the one on this website? https://timtigner.com/
  3. Hello, I would like to edit the following Javascript code to start automatically, when somebody lands on my page. The code is for a simple counter from https://styleddigital.com/blog/2017/5/10/how-to-add-an-animated-counter-in-squarespace. Unfortunately this question has not yet been answered there. Maybe you can help?
  4. I am looking for a blog post counter for my website. The blog on my website focuses on cigar reviews and each new post is a new cigar review. I would visitors to know how many cigars have been reviewed on my website in total using a blog post counter or the likes. Is this possible?
  5. Anybody have any idea how to add h2 matrix text to a single page (home page)? Thanks!
  6. Hello. First time here on the forum. I looked through plenty of previous threads, but didn't find the answer to my specific challenge. I built a site recently, and all was fine until today, when I added custom code to have a booking window open within the same frame. It worked fine on the testing page, but as soon as I added it to the other pages (confirmed clean/accurate copy and paste), it stopped working AND now I can no long add links within text fields. I've used the required <style></style>, and have tested by html in a w3schools.com test window. Here is a link to the test page: https://trout-lilac-h8f3.squarespace.com/home2. The navigation works, so other pages can be visited. Can anyone see what I've missed or done wrong? Thanks, in advance.
  7. Dear Community, I am in the process of making my website Multilingual. For the moment I have set up a test Squarespace website to experiment on, though the implementation on my live website will be the same. Website: http://lychee-sheep-23gt.squarespace.com/ Password: 123456789 Template: Brine I have followed the guide found here https://www.bradgood.net/articles/multi-language-content-on-any-squarespace-template with great success. However, I am stuck on the following: On the mobile / tablet view I would like the Language switcher to appear on the bottom of the mobile menu and not in the header... For reference here is the code I have used so far. CODE INJECTION FOOTER: CUSTOM CSS: Please take note: I am not a coder. I can understand instructions on code and modify them so they work for me.... If somebody could please help me with this, it would honestly make my day! Thanks Max
  8. I'm using Brine. I'm changing my logo image on specific pages by inserting the script below into the page header. However, since this only affects desktop with 'Header-branding-logo', the logo is not getting changed on the mobile versions of these pages. <script> window.onload = function() { document.getElementsByClassName('Header-branding-logo')[0].src = 'URL_TO_IMAGE'; }; </script> How would I add the functionality into this script or just use a new method to change the logo image on both desktop and mobile? Thanks in advance.
  9. Hello everyone. The floating pagination arrows for blog posts present in the Farro template aren't showing up for me in Chrome browsers. It seems like this is a known issue, specifically with these arrow symbols not showing in Chrome, as I believe the arrow referenced here (https://stackoverflow.com/questions/27265831/google-chrome-is-not-showing-arrow-sign) is the same one used for Farro's blog's floating pagination arrows, though I may be wrong. My website is still unpublished, so I can't link it. Has anyone else experienced this issue? Is it possible to replace the default symbols for the Farro template floating pagination arrows in blog posts? Is it possible via css? Below is some code for reference. I believe the red text is the arrow icons specifically. If necessary, I'd like to replace the default arrows with these: Right — https://fontawesome.com/icons/angle-right?style=solid Left — https://fontawesome.com/icons/angle-left?style=solid&from=io. Please let me know if any additional information is needed to solve this issue. Thanks in advance. ———————— FOR REFERENCE ———————— CSS: .tweak-icon-weight-heavy .Icon--caretLarge--left, .tweak-icon-weight-heavy .Icon--caretLarge--right, .tweak-icon-weight-heavy .Icon--caretSmall--left, .tweak-icon-weight-heavy .Icon--caretSmall--right HTML: <nav class="BlogItem-pagination clear BlogItem-pagination--loaded" data-controller="BlogItemPaginationArrows" data-controllers-bound="BlogItemPaginationArrows"> <a href="/home/traveling-with-some-intention" class="BlogItem-pagination-link BlogItem-pagination-link--prev"> <svg class="Icon Icon--caretSmall--left BlogItem-pagination-icon" viewBox="0 0 9 16"> <use xlink:href="/assets/ui-icons.svg#caret-left-small-icon"></use> </svg><!-- --><div class="BlogItem-pagination-content"> <h4 class="BlogItem-pagination-title">BLOG POST TITLE</h4> <div class="BlogItem-pagination-meta"><!-- Author --><span class="BlogItem-pagination-meta-item BlogItem-pagination-meta-item--author">AUTHOR NAME</span><!-- Date --><time class="BlogItem-pagination-meta-item BlogItem-pagination-meta-item--date" datetime="2019-10-11">October <span>11, </span>2019</time></div> </div> </a> <a href="/home/traveling-with-intention" class="BlogItem-pagination-link BlogItem-pagination-link--next"> <div class="BlogItem-pagination-content"> <h4 class="BlogItem-pagination-title">BLOG POST TITLE </h4> <div class="BlogItem-pagination-meta"><!-- Author --><span class="BlogItem-pagination-meta-item BlogItem-pagination-meta-item--author">AUTHOR NAME</span><!-- Date --><time class="BlogItem-pagination-meta-item BlogItem-pagination-meta-item--date" datetime="2019-10-10">October <span>10, </span>2019</time></div> </div><!-- --><svg class="Icon Icon--caretSmall--right BlogItem-pagination-icon" viewBox="0 0 9 16"> <use xlink:href="/assets/ui-icons.svg#caret-right-small-icon"></use> </svg> </a> </nav>
  10. Hello there, I have written a javascript with some jQuery to call an api and get some data to be rendered when a user clicks on a specific page. I have put this code inside the header of code injection section. But the problem is the script seems to execute only when user access the site the first time, not when they are accessing that specific page. Can anyone be able to help me out to have a workaround to this problem?
  11. Hi, I am working on a Squarespace store for a winery and need add some features to the checkout page. The customer's order cannot be processed unless it is a multiple of 12. I've been checking out forums for documentation of similar things but I haven't found much involving Squarespace pages. This website has a version of what I need (https://sage-hills-wine.myshopify.com/cart), however, I looked at their code and noticed that the "Order Limits" feature is integrated with Shopify, which I am not using. Does anyone have experience with this involving merely some custom code inserted via Code Injection, or should I be looking into alternative e-commerce software for this level of customization? Thank you
  12. I want to empty out the cart when I press a button. I tried setting the "CART" cookie value to null but that didn't do anything. Any Ideas? Help would be appreciated im using the Brine Template.
  13. Hello! I'm trying to create a javascript function where after a customer adds something to cart, they are sent to the cart. At the moment, they stay on the product page. I created this javascript, and it works to send the customer to the cart. However, the product doesn't appear in the cart right away. It seems like I need a delay to give Squarespace some time to add the product to the cart. I'm hoping to add a 2 or 3 second delay to allow for this. The button says "Adding..." then "Added!", so I'm not concerned about experience. Any help that can be provided would be great! <script> $(function() { var $button = $('.sqs-add-to-cart-button'); $button.on('click', function(){ window.location.href = 'https://www.pamelacardjewelry.com/cart'; }); }); </script>
  14. Currently using a code block to embed a widget to display reviews via (ReviewsOnMyWebsite). The widget is placed on the bottom of every page. On mobile, when clicking to a page from the navigation menu the widget doesn't appear. It only appears when I refresh the page manually. Even when going back into the navigation menu to click into another page, the widget is hidden again until I refresh. Is there a solution to this mobile bug? Code: <div data-token="Ilh6pzyvcFaj4QxwrrFT2pMKepSJIYGolNn7ZyA5Ix839AkoGa" class="romw-reviews"></div> <script src="https://reviewsonmywebsite.com/js/embedLoader.js?id=16985fd9e429040ba7c6" type="text/javascript"></script>
  15. i have an embedded script on my site's homepage that uses JQuery's ready method to execute a function whenever I load my website. The code executes when I load the homepage the first time. But if I navigate to another page on my site and then come back to the homepage, the function won't execute again. How can I fix this? Here's the code: <div id="api_text"> <script> $().ready(function() { $.get( "https://example_url_api.com/", function(data) { const results = JSON.parse(data.body); let print_string = ""; for (var result_key in results) { const result_string = results[result_key]; $("#api_text").append(result_key + " : "); $("#api_text").append(result_value + "<br/>"); print_string += result_string; } console.log(print_string); } ); }); </script> </div>
  16. Hey guys, This might be a basic problem but I want to enter the code under into the website custom page since it would allow me to collect data from the website into google analytic. However, it keeps saying that the there's a 'SYNTAX ERROR ON LINE 1' and I don't know what is the problem since this a copy that Google Analytic gaved me, I don't think I can remove something. Please help me :)
  17. Hi all, This is probably too big of an ask, but I'll try anyways. If we can figure this out, I'm sure it'll be useful to a ton of people. I'm looking to add an identical sticky navigation to the very top of two different websites/templates. One being Farro, the other Brine. Basically, I'm making a child brand/website of a parent website/brand, and want an universal navigation at the top of both websites. An example of what I'm looking for can be found on Deciem's website (https://deciem.com/?lang=en&region=US). There, they have a navigation which allows customers to easily visit the websites of their various brands. Similarly, I'd like to have have a universal header on both websites, with a box for the parent brand linking to its homepage, and a box for the child company linking to its homepage. Visitors of either site would be able to quickly and easily switch back and forth, and clearly see that the two brands are interconnected. I've found some useful attempts online, but nothing sufficient. Any help is appreciated. Thanks in advance.
  18. Hi, I want to ad the linkedin insight tag to my website. I browsed the forum and help guides but didn't find a solution. I don't know if it's possible. Anybody knows how to do that ? Here is a link to faq page on inkedin: https://www.linkedin.com/help/lms/answer/65521/the-linkedin-insight-tag-faqs?lang=en
  19. Hi there, Does anyone know of code or script that can enable the images in a carousel gallery block to be swiped through with a thumb on mobile or dragged side to side when held with a mouse? Any help would be most appreciated. Many thanks, Sam,
  20. I've been using some third-party widgets for my blog and never had an issue until this week. Now, the Javascript is simply a spinning circle and doesn't work on my phone or any browser. AJAX loading is disabled. All previous blog posts are also affected so it's not a new code issue. Any help on what I could add? post example: https://www.swiftfit.net/blog/affordable-alternatives-to-nordstrom-anniversary-sale
  21. Hey guys, I'm slowly learning front-end coding right now and want to implement ScrollMagic to my website. But I am absolutely clueless on where to even begin doing what it says on the documentation. Can anyone walk me through the basics? What I want is basically start an animation the moment the user scrolls down, it seems to me ScrollMagic is the closest one to what I want. A basic version of this. Thanks,
  22. I've attached a screenshot of the page in question. I wanna make the "Continue: Choose Add-ons" button only clickable if the customer clicked the "Submit Requirements" button above it. I'd like the error message to display "Please submit requirements before continuing". What code should I inject into the header for this to work? Thank you so much!
  23. Hi! I’m using the Brine template (Wav) and trying to customize my the gallery on my page so you can click a button to view thumbnails. I have the button, but I’m stuck on how to show/hide the thumbnail strip. So far, I have added this to the code injection: <script>function myFunction() { var x = document.getElementById("the div"); if (x.style.display === "none") { x.style.display = "block"; } else { x.style.display = "none"; } }</script> and this is the button on the page: <button onclick="myFunction()">Thumbnails</button> <div id="the div"><p> <br> Thumbnails here </p></div> This is the link to the page: https://adrian-merrick-aks4.squarespace.com/becky-copy Any advice would be greatly appreciated!!
  24. Greetings - I'm working on a site and have an embedded calendar... https://kwocv3.squarespace.com/calendar-events ...using this JavaScript that was provided to me... <div id="elvanto-calendar-1740"></div><script src="https://kwoc.elvanto.net/calendar_embed.js?c[]=add651f2-307c-11e5-af42-0673d9c9b5d6&fd=s&el_id=1740"></script> If you notice the events (see Sundays) - when you click on one, you get a pop-up that shows more details. However, I am unable to click on the "close" button. I've checked w/ the provider of this JS, but they said it would be something on SquareSpaces end... Any help would be greatly appreciated! Isaac
  25. I'm working on a site using the Tremont template see here I would like to transfer the mouseover effects of the index-navigation and apply these to the main-nav at the top right of the screen so as when you hover over the menu items they change the background video/image see here. I have achieved a similar effect on other projects but am having difficulty with 1. targeting the background video and 2. placing the images I wish to replace it with. Thanks in advance, any help would be greatly appreciated as I've been battling with this one for too long.
×
×
  • Create New...