
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
**gli.js** is a lightweight JavaScript library that provides a simplified alternative to jQuery. It offers a range of useful functions to manipulate the DOM, handle events, perform AJAX requests, and animate elements.
gli.js is a lightweight JavaScript library that provides a simplified alternative to jQuery. It offers a range of useful functions to manipulate the DOM, handle events, perform AJAX requests, and animate elements.
To use gli.js, include the script file in your HTML document:
<script src="https://cdn.jsdelivr.net/gh/SH20RAJ/gliJS@latest/gli.min.js"></script>
You can also download the gli.js file from the repository and host it locally.
You can select elements using the s
function and pass a CSS selector as a parameter:
var elements = s('.selector');
addClass(className)
: Adds the specified class to the selected elements.removeClass(className)
: Removes the specified class from the selected elements.toggleClass(className)
: Toggles the specified class on the selected elements.hide()
: Hides the selected elements.show()
: Shows the selected elements.text(content)
: Gets or sets the text content of the selected elements.attr(attributeName, value)
: Gets or sets the attribute value of the selected elements.removeAttr(attributeName)
: Removes the specified attribute from the selected elements.hasAttr(attributeName)
: Checks if the selected elements have the specified attribute.on(eventName, selector, handler)
: Attaches an event handler to the selected elements or their descendants.parent()
: Returns a new gli object containing the parent elements of the selected elements.children()
: Returns a new gli object containing the children elements of the selected elements.siblings()
: Returns a new gli object containing the sibling elements of the selected elements.get(url, successCallback, errorCallback)
: Performs an HTTP GET request.post(url, data, successCallback, errorCallback)
: Performs an HTTP POST request.animate(properties, duration, easing, completeCallback)
: Animates CSS properties of the selected elements.For more detailed information on each method and its parameters, please refer to the API Documentation.
s('#element').hide();
s('.elements').addClass('highlight');
s('.button').on('click', function(event) {
// Handle click event
});
s.get('https://api.example.com/data', function(response) {
// Handle successful response
}, function(errorStatus) {
// Handle error
});
s('.element').animate([
['opacity', 0, 1],
['width', '100px', '200px'],
], 1000, function(timestamp) {
// Animation complete
});
You can find more examples and use cases in the examples directory.
gli.js supports all modern browsers, including Chrome, Firefox, Safari, and Edge.
Contributions are welcome! Feel free to open an issue or submit a pull request for any improvements or fixes you'd like to contribute.
Please read the Contributing Guidelines for more details on how to contribute.
This library is released under the MIT License. See the LICENSE file for more details.
FAQs
**gli.js** is a lightweight JavaScript library that provides a simplified alternative to jQuery. It offers a range of useful functions to manipulate the DOM, handle events, perform AJAX requests, and animate elements.
The npm package glijs receives a total of 1 weekly downloads. As such, glijs popularity was classified as not popular.
We found that glijs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.