|
Thank you - yes I did, finally found that the webpack is not adding full url and it got fixed - thank you.
|
|
|
|
|
Greetings.
I am working on a one-page solution where each section has an ID.
I have made this very simple responsive menu, which looks quite nice, but I have noticed one major flaw.
In mobile view, if I click on a list from the navbar slide-menu, the page will scroll down to that particular ID. The problem is that the user needs to click on the navbar to manually close it, meaning that if they click on one of the links, they won't actually know if they are taken to that section, because the menu is in the way.
What I want is for the menu to close after clicking the link, so that people can see the page scrolling down to the section they were looking for.
How can I accomplish this?
If possible I would like an ES6 solution without JQuery
console.clear();
const navSlide= ()=> {
const burger = document.querySelector('.burger');
const nav = document.querySelector('.nav-links');
const navLinks=document.querySelectorAll('.nav-links li');
burger.addEventListener('click', () =>{
nav.classList.toggle('nav-active');
navLinks.forEach((link,index) =>{
if(link.style.animation) {
link.style.animation=''
} else {
link.style.animation=`navLinkFade 0.5s ease forwards ${index /7 + 0.2}s`;
}
console.log(index / 7);
});
burger.classList.toggle('toggle');
});
}
navSlide();
modified 17-Dec-19 15:03pm.
|
|
|
|
|
Hi - I am getting this following error when I am running an Ember application
Attempted to register a view with an id already in use: 2
- can somebody please help me in finding what would be the reasons for this error and how to fix them - any help would be very very helpful as I am new to Ember - thanks a lot
|
|
|
|
|
I know nothing about Ember, or even what it is, but I would say that message is fairly clear.
|
|
|
|
|
I know nothing about Ember, or even what it is, but I googled that error message and found a few articles that explain the problem and the solution. Have you done that yet? Have you tried any of those solutions? If any didn't work then say which ones and why.
|
|
|
|
|
|
Hi,
I appreciate your efforts to search by your own. However, here is some information about Ember.Js might helpful for you. "Ember.js is an open-source JavaScript web framework, based on the Model–view–viewmodel pattern. It allows developers to create scalable single-page web applications by incorporating common idioms and best practices into the framework. Ember is used on many popular websites, including Apple Music Square, Inc. Wikipedia"
|
|
|
|
|
Oh no, another JavaScript framework!
First time I've heard of Ember personally, or maybe I've read about it but didn't investigate.
Well, since the user pool is sooooo small, it's going to be hard to get help with it.
Looks to me like most of the help is outdated, and is polluting the inter webs with bad info.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
modified 12-Dec-19 15:11pm.
|
|
|
|
|
Agreed but it was already built so I didn't have any other option.
modified 12-Dec-19 14:01pm.
|
|
|
|
|
You are going to have to provide more help than this. You haven't actually provided any code at all so we can't guess at what your problem here could be.
|
|
|
|
|
Its big js file/files that's why I am thinking to put the code here but how I am still thinking my friend.
|
|
|
|
|
I need to add “Add new item” option in Select2
|
|
|
|
|
Please proceed, you have our permission to do so.
"Five fruits and vegetables a day? What a joke!
Personally, after the third watermelon, I'm full."
|
|
|
|
|
This is a place to ask questions, not just tell us what you want to do. What did you expect us to tell you?
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Can you please put some code or something so that people can help you - if you say like I want to create a project - how would someone knows what should he create - just like that ask where are you stuck after attempting couple of times etc. Good luck.
|
|
|
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>
<select id="mySel" class="select2">
<option></option>
<option value="NEW">Add new type</option>
<option>Car</option>
<option>BUS</option>
<option>TWO</option>
<option>THREE</option>
</select>
<pre>$(function () {
$(".select2")
.select2({
placeholder: 'Select type',
width: '50%',
minimumResultsForSearch: Infinity
})
.on('select2:close', function() {
var el = $(this);
if(el.val()==="NEW") {
var newval = prompt("Enter new value: ");
if(newval !== null) {
el.append('<option>'+newval+'</option>')
.val(newval);
}
}
});
});</pre>
|
|
|
|
|
Hi there,
I have created a random password and intend to send this password to the user's email. So that they can type in the password, to log into my course and at the same time use it as a verification.
Below is my random password code.
var passwordChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#@!%&()/";
var otp = Array(6).fill(passwordChars).map(function(x) {
return x[Math.floor(Math.random() * x.length)]
}).join('');
var player = GetPlayer();
player.SetVar("NewOTP",otp);
let's say the random code is O#bD3f
The text message in the email will be
Please key in the password O#bD3f
How to include NewOTP in to the text message.
Please help
Thanks.
|
|
|
|
|
freezers wrote: How to include NewOTP in to the text message. What is NewOTP? And why can't you add it to the email?
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
I have already done it...thanks.
|
|
|
|
|
string emailBody = string.Format("Please key in the password {0}", otp);
|
|
|
|
|
|
<pre><pre lang="Javascript">function registerHandlers() {
var as = document.getElementsByTagName('a');
for (var i = 0; i < as.length; i++) {
as[i].onclick = function() {
alert(i);
return true;
}
}
}</pre><pre>
And HTML:
In my life, I used the following web search engines:<br/>
<a href="//www.yahoo.com">Yahoo!</a><br/>
<a href="//www.altavista.com">AltaVista</a><br/>
<a href="//www.google.com">Google</a><br/>
|
|
|
|
|
|
Other option for scripting with onclick functionality
<pre> function registerHandlers() {
var as = document.getElementsByTagName('a');
for (var i = 0; i < as.length; i++) {
as[i].addEventListener('onclick', function() {
alert(i);
return true;
});
}
}
//Call Function Here on window load
window.addEventListener('load', function() {
registerHandlers();
});</pre>
|
|
|
|
|
Hi,
Quick question. Using Java Script to display dynamic htmlpages.
Question on how to make all the fields in a row high lighted in red based on a condition instead of doing each field.
Code below is what we are doing currently to set color for some fields based on condition.
But with a new condition all fields have to be highlighted in Red.
How to do it. There are around 20 fields in the row to conditionally highlight in red.
if (field.entered == 1 && field.pcnt_staged != '100%') {
fldText += '' + field.shipto + '';
}else{
fldText += '' + field.shipto + '';
}
thanks
|
|
|
|