Reputation Activity
-
mrludable reacted to Jack in Google Maps LinkThere's a directions API as part of Google Maps that lets you do this, what you're looking for is the waypoints part https://developers.google.com/maps/documentation/directions/.
It terms of hooking it up. It can be a fair bit of work because you first need to get the users location using something like Geolocation, ensure the coordinates are correct and parsable by the API, then you can pass them in and render. You also need to account for no location being specified, a user can opt out of having their location readable by a site, and you won't want JS errors because of this.
Hopefully this will help https://jmperezperez.com/google-maps-geolocation-directions-specific-destination/.
-
mrludable reacted to BrowserBugs in Google Maps LinkIf you have the lat long it's simple enough, structure is /maps/place/lat,long so here is the empire state building, https://www.google.co.uk/maps/place/40.748441,-73.985664.
Edit: No idea why the links are not working :s
-
mrludable reacted to rbrtsmith in Considering a career change -thoughts?Would you be more interested in the actual design or development side of things? Web design is a bit of misleading term as it used to encompass the design and development of a website, but now as websites have gotten far more complex they are typically built by teams of developers and designers. It is possible to do both, but to land a position sooner rather than later I'd advise you to focus on a particular area.
If it's development that is also often segregated into front-end and backend, and if you head down this road If you're not sure which to pick then try out both and see which you prefer. These days both are equally challenging and well paid, it's changed a lot since the days of all the logic being on the backend.
I started out just over 4 years ago by signing upto https://teamtreehouse.com/ and following their front-end development track. You can read my own story that they posted here https://teamtreehouse.com/stories/robert-smith, bear in mind that's around 18 months old now
I think it's possible to go from zero to being employable in under 2000 hours, I calculated my own and it roughly came out at 1800. That might sound daunting at first, but compare that to other entry level positions that require degrees and so on and it really is not so bad.
EDIT:
If I was starting out now I'd go with https://teamtreehouse.com/techdegree/front-end-web-development
The tech degree didn't exist when I started out but looking at what they teach there it puts you in a very strong place for junior positions - in fact knowing what they teach there you'd be more knowledgeable than the vast majority of junior devs out there, it really looks like a fantastic course for learning modern front-end development.
How to Make a Website Share Your Techdegree Projects With GitHub Desktop CSS Basics CSS Layout Basics Responsive Images HTML Tables HTML Forms CSS Selectors JavaScript Basics JavaScript Loops, Arrays and Objects Introduction to jQuery Using jQuery Plugins CSS to Sass Sass Basics CSS Flexbox Layout Build a Responsive Navigation with Flexbox CSS Transitions and Transforms SVG Basics Animating SVG with CSS Defining Variables with let and const Introducing Arrow Function Syntax Exploring JavaScript Conditionals JavaScript and the DOM DOM Scripting By Example HTML Video and Audio Create a Media Player with MediaElement.js Web Accessibility Compliance Git Basics Create Tooltips with CSS Using Local Storage with JavaScript Introducing Template Literals AJAX Basics Create a Fullscreen Slider with CSS Gulp Basics Front End Web Optimization Workflow Hosting a Website with GitHub Pages That above is a super curriculum for basic front-end development
Their tech degrees for other areas are also well worth considering if front-end does not interest you.
-
mrludable reacted to Lyndsey in input[type="radio"]:checked + span Styling IssueYou can use data-* attributes to achieve this in a much more compact way. This is an example:
<!-- data-ref corresponds to the target form to be displayed --> <input id="windowFront" class="js-radio-button" name="window" value="Front" type="radio" data-form="#damageChips"> <!-- target form to be displayed when the radio is changed --> <div id="damageChips" class="form-section js-form-section"> ... </div> // jQuery var $radioButtons = $('.js-radio-button'); var $forms = $('.js-form-section'); $radioButtons.change(function() { var $this = $(this); var targetForm = $this.data('form'); $forms.hide(); $(targetForm).show(); }); Fiddle demo: https://jsfiddle.net/usjoL467/4/
-
Why not add a classname to your radio buttons then your selectors won't be qualified so deeply and you will have reduced selector specificty.
.radio:checked + .radio-ui {} is much nicer than .options label input[type="radio"]:checked + span Qualifying selectors is really bad for maintainability. what happens if that span changes to a div or the label becomes a div and the span becomes a label? With a class you are not tied to the html element semantics so your concerns are no longer mixed.
I wouldn't use jQuery's hide/show helpers as they add in a bunch of CSS and do so quite inefficiently as Paul Irish alludes to here: https://twitter.com/paul_irish/status/564443848613847040?lang=en You are better to add / remove stateful classes such as .is-hidden / .is-active and so on.
-
mrludable reacted to rbrtsmith in jQuery & Radio ButtonsJack's advice is good, you never want to have a hook that mixes concerns (Single Responsibility Principle). Attaching the `.js` prefix tells you and other developers that this className is intended as a JavaScript hook and styling should not be attached.
Otherwise you run the risk of modifying or removing the class if you or a maintainer update the visual styling - not realising this class was in fact a JavaScript hook.
-
mrludable reacted to Jack in jQuery & Radio ButtonsI've changed your HTML slightly to add a class. I would recommend not styling this class, but treating it as something that binds your JS and HTML.
https://jsfiddle.net/g25mehjh/
-
mrludable reacted to rbrtsmith in HTML Form Help -
mrludable reacted to Nillervision in HTML Form Help -
mrludable reacted to rbrtsmith in jQuery ConflictYou can use the Dollar sign just fine with wordPress. you need to ensure you wrap all your code in a closure and properly alias it.
(function($) { // use dollar sign all you like here. })(jQuery); It's pretty verbose to use jQuery everywhere so make sure it's in scope like it will be in the example above.
-
mrludable reacted to Jack in Adding a Class to Article Sidebar LinksWithout being able to test anything out it's hard to say, the docs leave a lot to be desired. For example, if {{ blog.id }} is the ID of the blog entry you're on, you should be able to match it to {{ article.id }}
{% assign currentPageId = blog.id %} <ul> {% for article in blog.articles limit:20 %} <li>{{ article.id }} - {{ currentPageId }}</li> {% endfor %} </ul> Otherwise, you could probably grab the current article ID, loop through a list of all articles and find one that matches.
{% assign currentArticleId = article.id %} <ul> {% for article in blog.articles limit:20 %} <li>{{ article.id }} - {{ currentArticleId }}</li> {% endfor %} </ul> -
mrludable reacted to Jack in Adding a Class to Article Sidebar LinksI have no way of testing whether this actually works
{% for article in blog.articles limit:20 %} <li> <a href="{{ article.url }}" {% if link.active %}class="on"{% endif %} title="{{ article.title | escape }}">{{ article.title }} {{ page_title }}</a> </li> {% endfor %} -
mrludable reacted to Jack in Adding a Class to Article Sidebar LinksThat would be my recommendation too, it should work. I would output both URL's to see what they contain. Also, you need to set current_url outside of the article loop.
{% assign current_url = blog.url %} {% for article in blog.articles limit:20 %} {{ article.url }} {{ current_url }} {% endfor %} -
mrludable reacted to fisicx in Gift Voucher Plugin?This is the code: https://github.com/paypal/ipn-code-samples/tree/master/php
Add a new function to your functions.php and paste in the example code. Don't use the include, Just add the class from paypalipn.php to the function.
in the example code use wp_mail to send the email.
You can get all the payees data from the $res variable. I use explode to convert this into an array and then just use the bits I need.
Sorry if this all sounds a bit waffly but it all depends on your theme and how you are making the payment. for example if you are using in-context checkout then you don't need IPN
This plugin works but is a large sledgehammer to crack a very small nut: https://en-gb.wordpress.org/plugins/easy-digital-downloads/
-
mrludable reacted to fisicx in Gift Voucher Plugin?Easy to do.
After payment you just need a function that sends off the email with the voucher details. It all depends on how you are taking payments. PayPal has this great IPN feature that notifies you that payment is complete. You can add the ipn function to your functions.php and add use the wp_mail function to send the email.
Or you can use a digital download plugin, there are lots to choose form. But building the code into your theme is a much better and lightweight way to do things. If you want to do it yourself I can point you towards the necessary code.
-
mrludable reacted to fisicx in HTML5 AudioDoes he want everybody to leave his site?
No being able to turn off the audio will just about kill off any chances of conversion. And Google may agree as they don't like like sites that hijack user control.
And there is still the fact that auto starting audio and video is disliked by just about everybody. Except your client.
-
mrludable reacted to Nillervision in HTML5 AudioFirst of all remove the autoplay attribute (we will start the audio with js) add an id and a control attribute if you want the user to be able to control the audio with the native controls
<audio controls id="my-audio" src="audiofile.mp3"></audio> By adding the id you can now target the audio element and control the playback with javascript
Create a js function that fires when the document has loaded.,
In the function add the reference to the audio element and an if statement that checks if the browsers width is greater than [what ever you decide a mobile is]
If true: Call the build in play() function of the audio element.
window.addEventListener('load', function load(event) { var audio = document.getElementById('my-audio'); if (document.documentElement.clientWidth > 720) { audio.play(); } }); -
mrludable reacted to Nillervision in HTML5 AudioOr if you dont want the audio element at all on small devices you could create the element programmatically.
First create a placeholder in the document to nest the audio if you want the native controls
<div id="audio-placeholder"></div> Now simply create the audio element (and set the attributes) in the load function.
window.addEventListener('load', function load(event) { if (document.documentElement.clientWidth > 720) { var audio = document.createElement('audio'); var audioPlaceHolder = document.getElementById('audio-placeholder'); audio.setAttribute('src', 'audiofile.mp3'); audio.setAttribute('controls', ''); audioPlaceHolder.appendChild(audio); audio.play(); } }); -
mrludable reacted to Nillervision in HTML5 AudioThe final solution (if you dont need native controls) could be to create an audio object, in the memory, with reference to the audio file and NOT attach it to the document at all.
<!-- NO HTML NEEDED --> window.addEventListener('load', function load(event) { if (document.documentElement.clientWidth > 720) { var audio = new Audio('audiofile.mp3'); audio.play(); } }); -
mrludable reacted to Jack in HTML5 AudioDisplay none won't remove elements from the DOM, it literally just hides the content from view.
I know you've likely explained to the client why this is a terrible idea, but I'd go back and try again. If you're preventing audio on a mobile from autoplaying, then it's obvious that it's going to be just as bad on desktop. You also can't guarantee a lower viewport size is a desktop.
Having autoplaying audio is going to increase the bounce rate on the site considerably. There's a reason why Facebook decided against it on autoplaying videos.
-
mrludable reacted to nublue in Nameserver Update QueryWhichever nameservers are used, they need to hold all the DNS records. If all you are changing is the domain, you could stick with Company A's nameservers and just update the A record to point to the website. That's the least hassle option.
If you switch to Company B's nameservers, you need to replicate the current DNS records on their nameservers before switching.
-
Can you autoplay the video with javascript?
<script> document.addEventListener('DOMContentLoaded', function(){ var mainVideo= document.getElementById('main-video'); mainVideo.play(); }); </script> -
mrludable reacted to Labelarot45 in WordPress Site 'hacked'I would suggest Wordfence over iSecurity. I remember running into some problems with iSecurity. Also the /own-admin-login-url option is pretty pointless. Yet they still offer the option, which may cause some problems.
-
mrludable reacted to Nillervision in WordPress Site 'hacked'Sounds like somebody was able to inject javascript into the site. When you see the source in the developer tools do you see any script tags that shouldn't be there?
-
mrludable reacted to wesh.uk in Moving HostingHi Al
Depending on how you do it, yes and no. This is far best discussed with your actual hosting company, and their setup :-)