Skip to content

Instantly share code, notes, and snippets.

View mushfiqweb's full-sized avatar

Mushfiqur Rahman mushfiqweb

View GitHub Profile
.inputfile:focus + label {
outline: 1px dotted #000;
outline: -webkit-focus-ring-color auto 5px;
}
<label for="file"><strong>Choose a file</strong></label>
.inputfile + label * {
pointer-events: none;
}
<input type="file" name="file" id="file" class="inputfile" data-multiple-caption="{count} files selected" multiple />
var inputs = document.querySelectorAll( '.inputfile' );
Array.prototype.forEach.call( inputs, function( input )
{
var label = input.nextElementSibling,
labelVal = label.innerHTML;
input.addEventListener( 'change', function( e )
{
var fileName = '';
<html class="no-js">
<head>
<!-- remove this if you use Modernizr -->
<script>(function(e,t,n){var r=e.querySelectorAll("html")[0];r.className=r.className.replace(/(^|\s)no-js(\s|$)/,"$1js$2")})(document,window,0);</script>
</head>
</html>
.js .inputfile {
width: 0.1px;
height: 0.1px;
opacity: 0;
overflow: hidden;
position: absolute;
z-index: -1;
}
.no-js .inputfile + label {
input.addEventListener( 'focus', function(){ input.classList.add( 'has-focus' ); });
input.addEventListener( 'blur', function(){ input.classList.remove( 'has-focus' ); });
.inputfile:focus + label,
.inputfile.has-focus + label {
outline: 1px dotted #000;
outline: -webkit-focus-ring-color auto 5px;
}
class MyComponent extends React.Component {
// when the component is added to the DOM...
componentDidMount() {
window.addEventListener(‘resize’, this.onResizeHandler);
}
// when the component is removed from the DOM...
componentWillUnmount() {
window.removeEventListener(‘resize’, this.onResizeHandler);
}
class MyComponent extends React.Component {
// only re-render if the ID has changed!
shouldComponentUpdate(nextProps, nextState) {
return nextProps.id === this.props.id;
}
}
public void checkinternet()
{
var connection = NetworkInformation.GetInternetConnectionProfile();
bool status = (connection != null &&
connection.GetNetworkConnectivityLevel() == NetworkConnectivityLevel.InternetAccess);
}
NetworkInformation.NetworkStatusChanged += NetworkInformation_NetworkStatusChanged;
void NetworkInformation_NetworkStatusChanged(object sender)
{
if (DeviceNetworkInformation.IsNetworkAvailable)
{
//do you task
}
}