Navigate to id in Content widget from Text widget on Wordpress page

254
June 06, 2017, at 03:55 AM

I have a Wordpress page with a text widget containing a select dropdown menu, along with a JQuery function to scroll to an id of a dl element in a separate content widget on the same page. The dl elements are contained within separate columns on a different widget. Here is my function:

<select id="select">
    <option value="">Select an option</option>
    <option value="londonderry">Amherst</option>
</select>
<script>
jQuery("#select").on('click', function() {
    alert(this.value);
    jQuery('html, body').animate({
        scrollTop: jQuery("#" + this.value).offset().top
    }, 2000);
});
</script>

As content is spread over multiple columns, I just can't place the dropdown menu in one of the columns; placing the code in the header of the widget with the columns wraps it in paragraph tags. Any ideas on why this is not working?

READ ALSO
Fucntion parameter values to replace the integer from a string

Fucntion parameter values to replace the integer from a string

I have a function the parameter has more than one values which I'm passing them after a loopI want to use the values Im getting to replace integers in a string by there older

202
How to Fix a Dynamic Document Size Error?

How to Fix a Dynamic Document Size Error?

I have a Menu-list, and when I pass the mouse hover an item display another list, but this list is larger and change the height of the documentThis create a bug in the page

274
Stopping a Horizontal Scroller JQuery

Stopping a Horizontal Scroller JQuery

I am creating a horizontal scroller that you can click to scroll through images and everything scrolls fine, but I am not sure how I get the scroller to stop at the last pictureWhat I was trying to do was stop it at a certain pixel width but that is inconsistent

334
How to make a table in ReactJS sortable?

How to make a table in ReactJS sortable?

I am building a simple app in ReactJS that works with a JSON array by calling a certain APII am then populating the results of the array in a table

405