top of page

Forum Posts

Dev Vora
Jun 04, 2020
In Coding with Velo
Hey everyone, I have a P database collection in Wix of news automatically populating from rss feeds. Now I will connect that with repeater and in that repeater I want to show any random image, because feeds do not have images. So repeater is already connected to dataset of P database. It has no images. So I want randomly add images into each repeater. Now it could be done with adding images to Q database and adding reference fields in P database, but content is coming from external source every 4 hours and I cannot add manually all images in each row of P database generated dynamically. I want to automatically show any image from Q database full of just images, into repeater populated by dataset of P database. I tried many things but cannot come up with anything! Only solution I can think of is using other repeater of same layout and keeping number of entries same in both. So do have any solution for this!? @Yisrael (Wix)
1
0
125
Dev Vora
Mar 08, 2018
In Coding with Velo
Here's example code inn database collection that I want to pass: field name url for storing html codes that I would pass to HTML Box on dynamic pages. But I don't know why its not happening. So please help me in achieving it. Code on Dynamic Page: $w.onReady(function () { const itemUrl = $w('#dynamicDataset').getCurrentItem().url; $w("#html2").postMessage(itemUrl); }); I left the code in HTML Box empty as I want to pass it through post message from page code stored in my database. Here's example code in database collection that I want to pass: <html> <head> <style> @import url(https://fonts.googleapis.com/css?family=Oswald:400); body { background: #222428; font-family: "Oswald", sans-serif; } .chart { position: absolute; width: 450px; height: 450px; top: 50%; left: 50%; margin: -225px 0 0 -225px; } .doughnutTip { position: absolute; min-width: 30px; max-width: 300px; padding: 5px 15px; border-radius: 1px; background: rgba(0,0,0,.8); color: #ddd; font-size: 17px; text-shadow: 0 1px 0 #000; text-transform: uppercase; text-align: center; line-height: 1.3; letter-spacing: .06em; box-shadow: 0 1px 3px rgba(0,0,0,0.5); pointer-events: none; &::after { position: absolute; left: 50%; bottom: -6px; content: ""; height: 0; margin: 0 0 0 -6px; border-right: 5px solid transparent; border-left: 5px solid transparent; border-top: 6px solid rgba(0,0,0,.7); line-height: 0; } } .doughnutSummary { position: absolute; top: 50%; left: 50%; color: #d5d5d5; text-align: center; text-shadow: 0 -1px 0 #111; cursor: default; } .doughnutSummaryTitle { position: absolute; top: 50%; width: 100%; margin-top: -27%; font-size: 22px; letter-spacing: .06em; } .doughnutSummaryNumber { position: absolute; top: 50%; width: 100%; margin-top: -15%; font-size: 55px; } .chart path:hover { opacity: 0.65; }@import url(//fonts.googleapis.com/css?family=Oswald:400); body { background: #222428; font-family: "Oswald", sans-serif; } .chart { position: absolute; width: 450px; height: 450px; top: 50%; left: 50%; margin: -225px 0 0 -225px; } .doughnutTip { position: absolute; min-width: 30px; max-width: 300px; padding: 5px 15px; border-radius: 1px; background: rgba(0,0,0,.8); color: #ddd; font-size: 17px; text-shadow: 0 1px 0 #000; text-transform: uppercase; text-align: center; line-height: 1.3; letter-spacing: .06em; box-shadow: 0 1px 3px rgba(0,0,0,0.5); pointer-events: none; &::after { position: absolute; left: 50%; bottom: -6px; content: ""; height: 0; margin: 0 0 0 -6px; border-right: 5px solid transparent; border-left: 5px solid transparent; border-top: 6px solid rgba(0,0,0,.7); line-height: 0; } } .doughnutSummary { position: absolute; top: 50%; left: 50%; color: #d5d5d5; text-align: center; text-shadow: 0 -1px 0 #111; cursor: default; } .doughnutSummaryTitle { position: absolute; top: 50%; width: 100%; margin-top: -27%; font-size: 22px; letter-spacing: .06em; } .doughnutSummaryNumber { position: absolute; top: 50%; width: 100%; margin-top: -15%; font-size: 55px; } .chart path:hover { opacity: 0.65; } </style> <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script> <script> $(function(){ $("#doughnutChart").drawDoughnutChart([ { title: "Tokyo", value : 120, color: "#2C3E50" }, { title: "San Francisco", value: 100, color: "#FC4349" }, { title: "New York", value: 80, color: "#6DBCDB" }, { title: "London", value : 50, color: "#F7E248" }, { title: "Sydney", value : 40, color: "#D7DADB" }, { title: "Berlin", value : 50, color: "#FFF" } ]); }); /*! * jquery.drawDoughnutChart.js * Version: 0.4.1(Beta) * Inspired by Chart.js(http://www.chartjs.org/) * * Copyright 2014 hiro * https://github.com/githiro/drawDoughnutChart * Released under the MIT license. * */ ;(function($, undefined) { $.fn.drawDoughnutChart = function(data, options) { var $this = this, W = $this.width(), H = $this.height(), centerX = W/2, centerY = H/2, cos = Math.cos, sin = Math.sin, PI = Math.PI, settings = $.extend({ segmentShowStroke : true, segmentStrokeColor : "#0C1013", segmentStrokeWidth : 1, baseColor: "rgba(0,0,0,0.5)", baseOffset: 4, edgeOffset : 10,//offset from edge of $this percentageInnerCutout : 75, animation : true, animationSteps : 90, animationEasing : "easeInOutExpo", animateRotate : true, tipOffsetX: -8, tipOffsetY: -45, tipClass: "doughnutTip", summaryClass: "doughnutSummary", summaryTitle: "TOTAL:", summaryTitleClass: "doughnutSummaryTitle", summaryNumberClass: "doughnutSummaryNumber", beforeDraw: function() { }, afterDrawed : function() { }, onPathEnter : function(e,data) { }, onPathLeave : function(e,data) { } }, options), animationOptions = { linear : function (t) { return t; }, easeInOutExpo: function (t) { var v = t<.5 ? 8*t*t*t*t : 1-8*(--t)*t*t*t; return (v>1) ? 1 : v; } }, requestAnimFrame = function() { return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60); }; }(); settings.beforeDraw.call($this); var $svg = $('<svg width="' + W + '" height="' + H + '" viewBox="0 0 ' + W + ' ' + H + '" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"></svg>').appendTo($this), $paths = [], easingFunction = animationOptions[settings.animationEasing], doughnutRadius = Min([H / 2,W / 2]) - settings.edgeOffset, cutoutRadius = doughnutRadius * (settings.percentageInnerCutout / 100), segmentTotal = 0; //Draw base doughnut var baseDoughnutRadius = doughnutRadius + settings.baseOffset, baseCutoutRadius = cutoutRadius - settings.baseOffset; $(document.createElementNS('http://www.w3.org/2000/svg', 'path')) .attr({ "d": getHollowCirclePath(baseDoughnutRadius, baseCutoutRadius), "fill": settings.baseColor }) .appendTo($svg); //Set up pie segments wrapper var $pathGroup = $(document.createElementNS('http://www.w3.org/2000/svg', 'g')); $pathGroup.attr({opacity: 0}).appendTo($svg); //Set up tooltip var $tip = $('<div class="' + settings.tipClass + '" />').appendTo('body').hide(), tipW = $tip.width(), tipH = $tip.height(); //Set up center text area var summarySize = (cutoutRadius - (doughnutRadius - cutoutRadius)) * 2, $summary = $('<div class="' + settings.summaryClass + '" />') .appendTo($this) .css({ width: summarySize + "px", height: summarySize + "px", "margin-left": -(summarySize / 2) + "px", "margin-top": -(summarySize / 2) + "px" }); var $summaryTitle = $('<p class="' + settings.summaryTitleClass + '">' + settings.summaryTitle + '</p>').appendTo($summary); var $summaryNumber = $('<p class="' + settings.summaryNumberClass + '"></p>').appendTo($summary).css({opacity: 0}); for (var i = 0, len = data.length; i < len; i++) { segmentTotal += data[i].value; $paths[i] = $(document.createElementNS('http://www.w3.org/2000/svg', 'path')) .attr({ "stroke-width": settings.segmentStrokeWidth, "stroke": settings.segmentStrokeColor, "fill": data[i].color, "data-order": i }) .appendTo($pathGroup) .on("mouseenter", pathMouseEnter) .on("mouseleave", pathMouseLeave) .on("mousemove", pathMouseMove); } //Animation start animationLoop(drawPieSegments); //Functions function getHollowCirclePath(doughnutRadius, cutoutRadius) { //Calculate values for the path. //We needn't calculate startRadius, segmentAngle and endRadius, because base doughnut doesn't animate. var startRadius = -1.570,// -Math.PI/2 segmentAngle = 6.2831,// 1 * ((99.9999/100) * (PI*2)), endRadius = 4.7131,// startRadius + segmentAngle startX = centerX + cos(startRadius) * doughnutRadius, startY = centerY + sin(startRadius) * doughnutRadius, endX2 = centerX + cos(startRadius) * cutoutRadius, endY2 = centerY + sin(startRadius) * cutoutRadius, endX = centerX + cos(endRadius) * doughnutRadius, endY = centerY + sin(endRadius) * doughnutRadius, startX2 = centerX + cos(endRadius) * cutoutRadius, startY2 = centerY + sin(endRadius) * cutoutRadius; var cmd = [ 'M', startX, startY, 'A', doughnutRadius, doughnutRadius, 0, 1, 1, endX, endY,//Draw outer circle 'Z',//Close path 'M', startX2, startY2,//Move pointer 'A', cutoutRadius, cutoutRadius, 0, 1, 0, endX2, endY2,//Draw inner circle 'Z' ]; cmd = cmd.join(' '); return cmd; }; function pathMouseEnter(e) { var order = $(this).data().order; $tip.text(data[order].title + ": " + data[order].value) .fadeIn(200); settings.onPathEnter.apply($(this),[e,data]); } function pathMouseLeave(e) { $tip.hide(); settings.onPathLeave.apply($(this),[e,data]); } function pathMouseMove(e) { $tip.css({ top: e.pageY + settings.tipOffsetY, left: e.pageX - $tip.width() / 2 + settings.tipOffsetX }); } function drawPieSegments (animationDecimal) { var startRadius = -PI / 2,//-90 degree rotateAnimation = 1; if (settings.animation && settings.animateRotate) rotateAnimation = animationDecimal;//count up between0~1 drawDoughnutText(animationDecimal, segmentTotal); $pathGroup.attr("opacity", animationDecimal); //If data have only one value, we draw hollow circle(#1). if (data.length === 1 && (4.7122 < (rotateAnimation * ((data[0].value / segmentTotal) * (PI * 2)) + startRadius))) { $paths[0].attr("d", getHollowCirclePath(doughnutRadius, cutoutRadius)); return; } for (var i = 0, len = data.length; i < len; i++) { var segmentAngle = rotateAnimation * ((data[i].value / segmentTotal) * (PI * 2)), endRadius = startRadius + segmentAngle, largeArc = ((endRadius - startRadius) % (PI * 2)) > PI ? 1 : 0, startX = centerX + cos(startRadius) * doughnutRadius, startY = centerY + sin(startRadius) * doughnutRadius, endX2 = centerX + cos(startRadius) * cutoutRadius, endY2 = centerY + sin(startRadius) * cutoutRadius, endX = centerX + cos(endRadius) * doughnutRadius, endY = centerY + sin(endRadius) * doughnutRadius, startX2 = centerX + cos(endRadius) * cutoutRadius, startY2 = centerY + sin(endRadius) * cutoutRadius; var cmd = [ 'M', startX, startY,//Move pointer 'A', doughnutRadius, doughnutRadius, 0, largeArc, 1, endX, endY,//Draw outer arc path 'L', startX2, startY2,//Draw line path(this line connects outer and innner arc paths) 'A', cutoutRadius, cutoutRadius, 0, largeArc, 0, endX2, endY2,//Draw inner arc path 'Z'//Cloth path ]; $paths[i].attr("d", cmd.join(' ')); startRadius += segmentAngle; } } function drawDoughnutText(animationDecimal, segmentTotal) { $summaryNumber .css({opacity: animationDecimal}) .text((segmentTotal * animationDecimal).toFixed(1)); } function animateFrame(cnt, drawData) { var easeAdjustedAnimationPercent =(settings.animation)? CapValue(easingFunction(cnt), null, 0) : 1; drawData(easeAdjustedAnimationPercent); } function animationLoop(drawData) { var animFrameAmount = (settings.animation)? 1 / CapValue(settings.animationSteps, Number.MAX_VALUE, 1) : 1, cnt =(settings.animation)? 0 : 1; requestAnimFrame(function() { cnt += animFrameAmount; animateFrame(cnt, drawData); if (cnt <= 1) { requestAnimFrame(arguments.callee); } else { settings.afterDrawed.call($this); } }); } function Max(arr) { return Math.max.apply(null, arr); } function Min(arr) { return Math.min.apply(null, arr); } function isNumber(n) { return !isNaN(parseFloat(n)) && isFinite(n); } function CapValue(valueToCap, maxValue, minValue) { if (isNumber(maxValue) && valueToCap > maxValue) return maxValue; if (isNumber(minValue) && valueToCap < minValue) return minValue; return valueToCap; } return $this; }; })(jQuery); </script> </head> <body> <div id="doughnutChart" class="chart"></div> </body> </html><html> <head> <style> @import url(https://fonts.googleapis.com/css?family=Oswald:400); body { background: #222428; font-family: "Oswald", sans-serif; } .chart { position: absolute; width: 450px; height: 450px; top: 50%; left: 50%; margin: -225px 0 0 -225px; } .doughnutTip { position: absolute; min-width: 30px; max-width: 300px; padding: 5px 15px; border-radius: 1px; background: rgba(0,0,0,.8); color: #ddd; font-size: 17px; text-shadow: 0 1px 0 #000; text-transform: uppercase; text-align: center; line-height: 1.3; letter-spacing: .06em; box-shadow: 0 1px 3px rgba(0,0,0,0.5); pointer-events: none; &::after { position: absolute; left: 50%; bottom: -6px; content: ""; height: 0; margin: 0 0 0 -6px; border-right: 5px solid transparent; border-left: 5px solid transparent; border-top: 6px solid rgba(0,0,0,.7); line-height: 0; } } .doughnutSummary { position: absolute; top: 50%; left: 50%; color: #d5d5d5; text-align: center; text-shadow: 0 -1px 0 #111; cursor: default; } .doughnutSummaryTitle { position: absolute; top: 50%; width: 100%; margin-top: -27%; font-size: 22px; letter-spacing: .06em; } .doughnutSummaryNumber { position: absolute; top: 50%; width: 100%; margin-top: -15%; font-size: 55px; } .chart path:hover { opacity: 0.65; }@import url(//fonts.googleapis.com/css?family=Oswald:400); body { background: #222428; font-family: "Oswald", sans-serif; } .chart { position: absolute; width: 450px; height: 450px; top: 50%; left: 50%; margin: -225px 0 0 -225px; } .doughnutTip { position: absolute; min-width: 30px; max-width: 300px; padding: 5px 15px; border-radius: 1px; background: rgba(0,0,0,.8); color: #ddd; font-size: 17px; text-shadow: 0 1px 0 #000; text-transform: uppercase; text-align: center; line-height: 1.3; letter-spacing: .06em; box-shadow: 0 1px 3px rgba(0,0,0,0.5); pointer-events: none; &::after { position: absolute; left: 50%; bottom: -6px; content: ""; height: 0; margin: 0 0 0 -6px; border-right: 5px solid transparent; border-left: 5px solid transparent; border-top: 6px solid rgba(0,0,0,.7); line-height: 0; } } .doughnutSummary { position: absolute; top: 50%; left: 50%; color: #d5d5d5; text-align: center; text-shadow: 0 -1px 0 #111; cursor: default; } .doughnutSummaryTitle { position: absolute; top: 50%; width: 100%; margin-top: -27%; font-size: 22px; letter-spacing: .06em; } .doughnutSummaryNumber { position: absolute; top: 50%; width: 100%; margin-top: -15%; font-size: 55px; } .chart path:hover { opacity: 0.65; } </style> <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script> <script> $(function(){ $("#doughnutChart").drawDoughnutChart([ { title: "Tokyo", value : 120, color: "#2C3E50" }, { title: "San Francisco", value: 100, color: "#FC4349" }, { title: "New York", value: 80, color: "#6DBCDB" }, { title: "London", value : 50, color: "#F7E248" }, { title: "Sydney", value : 40, color: "#D7DADB" }, { title: "Berlin", value : 50, color: "#FFF" } ]); }); /*! * jquery.drawDoughnutChart.js * Version: 0.4.1(Beta) * Inspired by Chart.js(http://www.chartjs.org/) * * Copyright 2014 hiro * https://github.com/githiro/drawDoughnutChart * Released under the MIT license. * */ ;(function($, undefined) { $.fn.drawDoughnutChart = function(data, options) { var $this = this, W = $this.width(), H = $this.height(), centerX = W/2, centerY = H/2, cos = Math.cos, sin = Math.sin, PI = Math.PI, settings = $.extend({ segmentShowStroke : true, segmentStrokeColor : "#0C1013", segmentStrokeWidth : 1, baseColor: "rgba(0,0,0,0.5)", baseOffset: 4, edgeOffset : 10,//offset from edge of $this percentageInnerCutout : 75, animation : true, animationSteps : 90, animationEasing : "easeInOutExpo", animateRotate : true, tipOffsetX: -8, tipOffsetY: -45, tipClass: "doughnutTip", summaryClass: "doughnutSummary", summaryTitle: "TOTAL:", summaryTitleClass: "doughnutSummaryTitle", summaryNumberClass: "doughnutSummaryNumber", beforeDraw: function() { }, afterDrawed : function() { }, onPathEnter : function(e,data) { }, onPathLeave : function(e,data) { } }, options), animationOptions = { linear : function (t) { return t; }, easeInOutExpo: function (t) { var v = t<.5 ? 8*t*t*t*t : 1-8*(--t)*t*t*t; return (v>1) ? 1 : v; } }, requestAnimFrame = function() { return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60); }; }(); settings.beforeDraw.call($this); var $svg = $('<svg width="' + W + '" height="' + H + '" viewBox="0 0 ' + W + ' ' + H + '" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"></svg>').appendTo($this), $paths = [], easingFunction = animationOptions[settings.animationEasing], doughnutRadius = Min([H / 2,W / 2]) - settings.edgeOffset, cutoutRadius = doughnutRadius * (settings.percentageInnerCutout / 100), segmentTotal = 0; //Draw base doughnut var baseDoughnutRadius = doughnutRadius + settings.baseOffset, baseCutoutRadius = cutoutRadius - settings.baseOffset; $(document.createElementNS('http://www.w3.org/2000/svg', 'path')) .attr({ "d": getHollowCirclePath(baseDoughnutRadius, baseCutoutRadius), "fill": settings.baseColor }) .appendTo($svg); //Set up pie segments wrapper var $pathGroup = $(document.createElementNS('http://www.w3.org/2000/svg', 'g')); $pathGroup.attr({opacity: 0}).appendTo($svg); //Set up tooltip var $tip = $('<div class="' + settings.tipClass + '" />').appendTo('body').hide(), tipW = $tip.width(), tipH = $tip.height(); //Set up center text area var summarySize = (cutoutRadius - (doughnutRadius - cutoutRadius)) * 2, $summary = $('<div class="' + settings.summaryClass + '" />') .appendTo($this) .css({ width: summarySize + "px", height: summarySize + "px", "margin-left": -(summarySize / 2) + "px", "margin-top": -(summarySize / 2) + "px" }); var $summaryTitle = $('<p class="' + settings.summaryTitleClass + '">' + settings.summaryTitle + '</p>').appendTo($summary); var $summaryNumber = $('<p class="' + settings.summaryNumberClass + '"></p>').appendTo($summary).css({opacity: 0}); for (var i = 0, len = data.length; i < len; i++) { segmentTotal += data[i].value; $paths[i] = $(document.createElementNS('http://www.w3.org/2000/svg', 'path')) .attr({ "stroke-width": settings.segmentStrokeWidth, "stroke": settings.segmentStrokeColor, "fill": data[i].color, "data-order": i }) .appendTo($pathGroup) .on("mouseenter", pathMouseEnter) .on("mouseleave", pathMouseLeave) .on("mousemove", pathMouseMove); } //Animation start animationLoop(drawPieSegments); //Functions function getHollowCirclePath(doughnutRadius, cutoutRadius) { //Calculate values for the path. //We needn't calculate startRadius, segmentAngle and endRadius, because base doughnut doesn't animate. var startRadius = -1.570,// -Math.PI/2 segmentAngle = 6.2831,// 1 * ((99.9999/100) * (PI*2)), endRadius = 4.7131,// startRadius + segmentAngle startX = centerX + cos(startRadius) * doughnutRadius, startY = centerY + sin(startRadius) * doughnutRadius, endX2 = centerX + cos(startRadius) * cutoutRadius, endY2 = centerY + sin(startRadius) * cutoutRadius, endX = centerX + cos(endRadius) * doughnutRadius, endY = centerY + sin(endRadius) * doughnutRadius, startX2 = centerX + cos(endRadius) * cutoutRadius, startY2 = centerY + sin(endRadius) * cutoutRadius; var cmd = [ 'M', startX, startY, 'A', doughnutRadius, doughnutRadius, 0, 1, 1, endX, endY,//Draw outer circle 'Z',//Close path 'M', startX2, startY2,//Move pointer 'A', cutoutRadius, cutoutRadius, 0, 1, 0, endX2, endY2,//Draw inner circle 'Z' ]; cmd = cmd.join(' '); return cmd; }; function pathMouseEnter(e) { var order = $(this).data().order; $tip.text(data[order].title + ": " + data[order].value) .fadeIn(200); settings.onPathEnter.apply($(this),[e,data]); } function pathMouseLeave(e) { $tip.hide(); settings.onPathLeave.apply($(this),[e,data]); } function pathMouseMove(e) { $tip.css({ top: e.pageY + settings.tipOffsetY, left: e.pageX - $tip.width() / 2 + settings.tipOffsetX }); } function drawPieSegments (animationDecimal) { var startRadius = -PI / 2,//-90 degree rotateAnimation = 1; if (settings.animation && settings.animateRotate) rotateAnimation = animationDecimal;//count up between0~1 drawDoughnutText(animationDecimal, segmentTotal); $pathGroup.attr("opacity", animationDecimal); //If data have only one value, we draw hollow circle(#1). if (data.length === 1 && (4.7122 < (rotateAnimation * ((data[0].value / segmentTotal) * (PI * 2)) + startRadius))) { $paths[0].attr("d", getHollowCirclePath(doughnutRadius, cutoutRadius)); return; } for (var i = 0, len = data.length; i < len; i++) { var segmentAngle = rotateAnimation * ((data[i].value / segmentTotal) * (PI * 2)), endRadius = startRadius + segmentAngle, largeArc = ((endRadius - startRadius) % (PI * 2)) > PI ? 1 : 0, startX = centerX + cos(startRadius) * doughnutRadius, startY = centerY + sin(startRadius) * doughnutRadius, endX2 = centerX + cos(startRadius) * cutoutRadius, endY2 = centerY + sin(startRadius) * cutoutRadius, endX = centerX + cos(endRadius) * doughnutRadius, endY = centerY + sin(endRadius) * doughnutRadius, startX2 = centerX + cos(endRadius) * cutoutRadius, startY2 = centerY + sin(endRadius) * cutoutRadius; var cmd = [ 'M', startX, startY,//Move pointer 'A', doughnutRadius, doughnutRadius, 0, largeArc, 1, endX, endY,//Draw outer arc path 'L', startX2, startY2,//Draw line path(this line connects outer and innner arc paths) 'A', cutoutRadius, cutoutRadius, 0, largeArc, 0, endX2, endY2,//Draw inner arc path 'Z'//Cloth path ]; $paths[i].attr("d", cmd.join(' ')); startRadius += segmentAngle; } } function drawDoughnutText(animationDecimal, segmentTotal) { $summaryNumber .css({opacity: animationDecimal}) .text((segmentTotal * animationDecimal).toFixed(1)); } function animateFrame(cnt, drawData) { var easeAdjustedAnimationPercent =(settings.animation)? CapValue(easingFunction(cnt), null, 0) : 1; drawData(easeAdjustedAnimationPercent); } function animationLoop(drawData) { var animFrameAmount = (settings.animation)? 1 / CapValue(settings.animationSteps, Number.MAX_VALUE, 1) : 1, cnt =(settings.animation)? 0 : 1; requestAnimFrame(function() { cnt += animFrameAmount; animateFrame(cnt, drawData); if (cnt <= 1) { requestAnimFrame(arguments.callee); } else { settings.afterDrawed.call($this); } }); } function Max(arr) { return Math.max.apply(null, arr); } function Min(arr) { return Math.min.apply(null, arr); } function isNumber(n) { return !isNaN(parseFloat(n)) && isFinite(n); } function CapValue(valueToCap, maxValue, minValue) { if (isNumber(maxValue) && valueToCap > maxValue) return maxValue; if (isNumber(minValue) && valueToCap < minValue) return minValue; return valueToCap; } return $this; }; })(jQuery); </script> </head> <body> <div id="doughnutChart" class="chart"></div> </body> </html> Sorry for this long code. Thanks.
Pass HTML code to HTML Box dynamically content media
2
7
1k
Dev Vora
Jan 31, 2018
In Coding with Velo
Hello, I have checked all post related to Dynamic Lightbox and repeaters. I want to connect repeaters generated from database with lightbox. I checked that I can connect button of repeater to lightbox and can pass data into it. So I need help in connecting it. See the below images: Please help me in making this! And tell me which code I need ! Thanks, Dev.
Connect Dynamic Repeater with LightBox content media
1
4
1k
Dev Vora
Jan 23, 2018
In Coding with Velo
I have a lightbox (#lightbox1) which has a some content like title and descripption inside it. I want this lightbox to be filled in automatically based on which button on the page I clicked on to open the lightbox. I want to do this by clicking on buttons in repeater and auto populate the lightbox according to button I click. How can I achieve this? Please help me. Thank You.
1
7
1k
Dev Vora
Dec 30, 2017
In Coding with Velo
I want to make post reaction counter as in https://blog.eu.playstation.com/2017/12/27/playstation-developers-pick-their-favourite-games-of-2017/ in the end of post. I think its possible with wix code by adding icon buttons and then with onclick function its possible. But I don't know how to make it work as same in above link, if we click one then number below updates with different colour and if I click other one, the before clicked button gets updated and also number below is updated. If possible can I get code to achieve this on single post page of old wix blog?
How to make post reaction counter? content media
2
6
369
Dev Vora
Dec 17, 2017
In Coding with Velo
I am building a game review website, for that I am making dynamic pages and every page should have graph/chart giving different ratings to game like graphics, gameplay etc from base rating of 10! I am really new to code, but I want to build this in every page and graph should like this in this link: https://codepen.io/vajkri/pen/NxzZwL or https://codepen.io/nickbytes/pen/chavk Now, I tried this very much, but still its not working. I don't how to put html and css together and also js in it! Please help me out in achieving this, I want to make this charts for different games! If you can give me step by step guide! Thank You!
1
11
650
Dev Vora
Dec 09, 2017
In Coding with Velo
I want to create 3D lightbox, like on this website: https://codepen.io/MarcMalignan/pen/xByvJ Is it possible with wix code?
1
4
101
Dev Vora
Dec 09, 2017
In Coding with Velo
Are hovering effects possible behind moving mouse on big container box on page like on this website: https://launchx.com/ or like this effects given below: https://codepen.io/soulwire/pen/Ffvlo https://codepen.io/soulwire/pen/foktm https://codepen.io/renatorib/pen/gBLDA I think its possible with wix code, but I don't know how to do it! If this is possible then it will give any website amazing effects! Please help me in doing this with wix code on website! Thank You!
1
9
1k
Dev Vora
Sep 29, 2017
In Coding with Velo
Hey, Please help me! How to display lightbox only once everyday to each user. I mean everyday lightbox appeas once! I don't want to put in local storage as it will display only once but I want to display lightbox everyday one time to user! Please provide me with code as I don't know coding. I hope for reply. Thanking You, Dev Vora.
2
12
1k
Dev Vora
Aug 14, 2017
In Coding with Velo
I don't know too much about coding but yesterday I came to know about wix code. I was really happy that I can make any website. I want to create college rating website for our state which has all the list of colleges and I want to create with cascading form that user selects category and then according to that colleges are displayed and then selects college among that list displayed and that particular college page is displayed with its rating. I also want to add feature through which users rate colleges and search bar for college. Please guide me how can I do this. I hope for reply. Thank you!
1
6
102

Dev Vora

More actions
bottom of page