






















Save Time and Summarize with AI
Moving pianos and musical instruments requires far more than strength and standard moving equipment. These instruments are precision-built, highly sensitive to impact, temperature, humidity, and improper handling. Professional piano movers like Moving of America provide specialized piano and instrument moving services in New Jersey designed to protect the structural integrity, sound quality, and long-term value of your instruments. As a leading piano moving company, we understand that each move involves unique challenges and demands expert care.
Since 2007, our licensed and insured movers have helped homeowners, musicians, schools, venues, and institutions relocate upright pianos, baby grands, concert grands, organs, and delicate musical instruments with care and expertise.
When clients search for affordable piano movers, they rely on us to deliver exceptional service without compromising safety. As a trusted New Jersey moving company, we understand that instruments are not just belongings—they are investments, tools of expression, and often irreplaceable pieces with deep personal or professional value.
Every piano and instrument move begins with careful planning. We assess size, weight, access points, staircases, flooring, and environmental conditions to determine the safest approach. As one of the best piano moving services in New Jersey, our crews use specialized equipment, padding systems, and controlled techniques to prevent shifting, vibration, or pressure damage during transport. For those searching for piano movers near me, our local expertise ensures responsive and personalized solutions.
Whether you are moving locally within New Jersey, relocating an instrument interstate, or coordinating temporary storage, Moving of America delivers reliable, white–glove–level service. If you need a piano relocation service that guarantees meticulous attention to detail, our team stands ready. When sound quality, craftsmanship, and condition matter, you need movers who treat instruments with the respect they deserve.
Pianos and musical instruments are uniquely complex. A piano can weigh anywhere from 300 to over 1,200 pounds, with thousands of moving parts calibrated to precise tolerances. Local piano movers must understand that even minor impacts or environmental changes can affect tuning, alignment, and structural integrity. Long-distance piano movers must plan meticulously to keep instruments protected across every mile.
Standard moving techniques often fail to account for these risks. Improper lifting can damage internal components, crack soundboards, or stress legs and frames. Exposure to humidity or temperature swings can warp wood, loosen adhesives, and compromise sound quality. That’s why insured piano movers are essential for peace of mind—ensuring your piano is protected against unforeseen incidents throughout the journey.
Professional piano movers take a specialized approach. Each instrument is evaluated for type, weight, construction, and access challenges. Residential piano moving services are tailored to homes and apartments, while commercial piano movers are trained to coordinate with venues, schools, and institutions. Protective padding, skid boards, piano dollies, and secure strapping systems are used to stabilize the instrument throughout the move. Transport vehicles are selected for smooth suspension and climate stability.
At Moving of America, our piano and instrument movers are trained specifically for these challenges. We move slowly, deliberately, and methodically—never rushing an instrument move. For a precise piano-moving estimate, we factor in every variable, from instrument type to access concerns, to provide you with an accurate projection before the move begins. Our specialized expertise dramatically reduces risk and ensures your piano or instrument arrives ready for use, not repair.
Over our decades of caring for our customers’ valuables, we’ve learned that not every move is the same. That’s why we offer flexible moving packages—so you can get exactly what you need and nothing you don’t.
In Addition to Bronze Package:
In Addition to Silver Package:
In Addition to Gold Package:
In Addition to Platinum Package:
Our piano moving services in New Jersey are designed for all piano types, including uprights, baby grands, grand pianos, concert grands, and specialty pianos. When you request a piano moving quote, we tailor our approach to your instrument’s size, weight, and environment. Upright piano movers are assigned to vertical pianos, while grand piano movers bring experience with larger and more complex instruments.
The process begins with a site evaluation to determine access points, stairways, door widths, flooring, and elevation changes. Based on this assessment, we select the appropriate equipment and crew size. Baby grand piano movers are trained to handle the unique balance and shape of these instruments. Specialist piano movers rely on proven techniques and equipment to minimize risk and ensure safe passage through challenging spaces. Pianos are carefully wrapped with protective padding and secured to specialized boards or dollies designed to distribute weight evenly.
During transport, pianos are stabilized inside the truck to prevent shifting. Piano packing and moving require careful attention to both the instrument and its environment. For delicate instrument movers, every precaution is taken to reduce vibration and prevent accidental impact. Heavy piano movers have the strength and equipment to safely handle even the largest pianos. For long-distance or interstate piano moves, additional precautions are used to maintain consistent conditions throughout transit.
Upon delivery, our movers carefully position the piano in its new location, ensuring proper placement and protecting the floor. Our piano transport service covers every detail, from the moment we pick up your instrument to the final placement at your destination. If you’re looking for an insured piano moving company, our coverage provides added peace of mind. Additionally, licensed piano movers oversee each step, guaranteeing compliance and professionalism.
In addition to pianos, we provide professional instrument movers for a wide range of instruments, including organs, harps, string instruments, percussion equipment, and electronic instruments. Our team also handles piano delivery and setup, ensuring your instrument is moved, placed, and prepared for use immediately upon arrival.
Each instrument type presents unique challenges. String instruments require vibration control and careful packing. Large instruments such as organs or harps often need partial disassembly and custom support. Electronic instruments require protection from moisture and impact.
Our team selects packing materials and handling methods based on the instrument’s construction and sensitivity. For urgent needs, same-day piano movers are available for rapid response throughout New Jersey. When necessary, custom packing or crating is used to provide additional protection, particularly for long-distance or high-value instruments.
Specialized equipment is essential for safe piano and instrument moving. Our piano removal and relocation expertise includes the use of professional-grade tools designed specifically for heavy and delicate instruments.
This includes piano boards, skid systems, heavy-duty dollies, custom strapping, and reinforced padding. Floors, staircases, door frames, and walls are protected throughout the move to prevent property damage.
For instruments that require additional protection, we offer custom packing and crating solutions. These are particularly valuable for interstate moves, institutional relocations, or instruments with unique shapes or finishes. Our piano moving and storage services provide secure, climate-controlled environments for temporary or extended holding, protecting your instrument until it’s ready for delivery.
Many instruments are highly sensitive to environmental conditions. Our piano moving cost includes climate-controlled moving and storage services to help protect pianos and instruments from humidity fluctuations and temperature extremes, ensuring you know exactly what to expect upfront.
Transport vehicles are selected to provide stable conditions during transit. If you need piano movers free estimate, our team will provide transparent pricing for both moving and storage, helping you plan every aspect of your move.
This controlled environment helps prevent warping, cracking, and internal damage that can occur when instruments are exposed to unstable conditions.
We provide piano and instrument moving services across residential, commercial, and institutional settings. If you’re looking for piano movers for local moves, our crews have the experience and local knowledge to safely handle challenging staircases and tight access points.
Schools, churches, studios, performance venues, and institutions trust us to move instruments with precision and discretion. We coordinate closely with facility managers and administrators to meet scheduling, access, and placement requirements.
Estate moves involving pianos or instruments are handled with care and respect, often involving multiple destinations or coordination with family representatives.
Our wine cellar moving process is designed to ensure absolute care and efficiency at every stage:
Certain items deserve more than just careful handling. Whether it’s a grand piano, delicate chandelier, or fine art, our trained professionals use specialized equipment and proven techniques to ensure your most valuable possessions are moved safely and securely.























If you are planning a move involving a piano or musical instruments, trust Moving of America to provide professional, careful, and reliable service. Our experienced movers understand the responsibility involved in transporting instruments and take every precaution to protect them.
Contact us today for a personalized piano and instrument moving quote and move forward with confidence.
Monday-Friday: 8 AM-8 PM | Saturday-Sunday: 8 AM-8 PM
Speak directly with a moving specialist who can answer all your questions, and most quotes are provided within 2 hours!
Fill out our quick form
Get your detailed, customized estimate within 24 hours, with no obligation.
Our team will respond within four business hours on weekdays.
Accredited by the Better Business Bureau with an A+ rating, reflecting our commitment to trust and customer satisfaction. We follow strict ethical business practices to ensure reliable and transparent moving services.

Proud member of the Chamber of Commerce, supporting professional standards and local business growth. Our membership reflects our dedication to credibility, networking, and community involvement.

Registered with the NJ Movers Association, ensuring compliance with industry regulations and standards. We operate with professionalism, accountability, and adherence to New Jersey moving guidelines.
The little details make moving day feel lighter.
A labeled box. A clear path. A careful hand on every corner. That is how our team keeps the day moving without the usual chaos.
From fragile kitchen items to the boxes you need first when you walk into your new home, we treat every piece like it matters because it does. 📦
Planning a move in New Jersey? Let’s make your next move feel organized from the first box to the last.
#MovingOfAmerica #MovingDay #NJMovers #NewJerseyMovers #MovingCompany #ProfessionalMovers #ResidentialMoving #LocalMovers #MovingServices #PackingServices #PackingTips #RelocationServices #HomeMoving #ApartmentMoving #CondoMoving #FragileItems #KitchenPacking #MovingHelp #NewJersey #BergenCounty #EssexCounty #PassaicCounty #HudsonCounty #MorrisCounty #NorthJersey #TriStateMoving #MoversYouCanTrust #YourPerfectMove
The little details make moving day feel lighter.
A labeled box. A clear path. A careful hand on every corner. That is how our team keeps the day moving without the usual chaos.
From fragile kitchen items to the boxes you need first when you walk into your new home, we treat every piece like it matters because it does. 📦
Planning a move in New Jersey? Let’s make your next move feel organized from the first box to the last.
#MovingOfAmerica #MovingDay #NJMovers #NewJerseyMovers #MovingCompany #ProfessionalMovers #ResidentialMoving #LocalMovers #MovingServices #PackingServices #PackingTips #RelocationServices #HomeMoving #ApartmentMoving #CondoMoving #FragileItems #KitchenPacking #MovingHelp #NewJersey #BergenCounty #EssexCounty #PassaicCounty #HudsonCounty #MorrisCounty #NorthJersey #TriStateMoving #MoversYouCanTrust #YourPerfectMove
...
Bergen County pickup. Florida delivery by the weekend. 🌴
This is what dedicated white glove moving looks like when timing matters.
Our team handled a weekday pickup in Bergen County and took the shipment straight to Florida with dedicated service, careful handling, and a clear plan from start to finish.
Fewer touchpoints. More accountability. The kind of move where every detail has to travel well.
Planning a move from New Jersey to Florida? Let’s make the distance feel simple.
#MovingOfAmerica #WhiteGloveMoving #LongDistanceMoving #DedicatedMovingService #NJToFlorida #FloridaMove #InterstateMoving #BergenCountyMovers #BergenCountyNJ #NewJerseyMovers #NJMovers #MovingCompany #ProfessionalMovers #LuxuryMoving #ResidentialMoving #MovingDay #Relocation #RelocationServices #NewHome #OutOfStateMove #FloridaRelocation #TriStateMovers #EastCoastMoving #FullServiceMoving #LicensedMovers #InsuredMovers #YourMoveDoneRight
Bergen County pickup. Florida delivery by the weekend. 🌴
This is what dedicated white glove moving looks like when timing matters.
Our team handled a weekday pickup in Bergen County and took the shipment straight to Florida with dedicated service, careful handling, and a clear plan from start to finish.
Fewer touchpoints. More accountability. The kind of move where every detail has to travel well.
Planning a move from New Jersey to Florida? Let’s make the distance feel simple.
#MovingOfAmerica #WhiteGloveMoving #LongDistanceMoving #DedicatedMovingService #NJToFlorida #FloridaMove #InterstateMoving #BergenCountyMovers #BergenCountyNJ #NewJerseyMovers #NJMovers #MovingCompany #ProfessionalMovers #LuxuryMoving #ResidentialMoving #MovingDay #Relocation #RelocationServices #NewHome #OutOfStateMove #FloridaRelocation #TriStateMovers #EastCoastMoving #FullServiceMoving #LicensedMovers #InsuredMovers #YourMoveDoneRight
...
When the stairs are not the best option, we find another way.
This wrapped furniture piece needed a careful handoff from the loft level, so our team protected the space, set the ladders, wrapped the item, and worked together one step at a time.
Moves like this are all about patience, communication, and knowing when to slow down. That is how we protect the home, the furniture, and everyone on the job. 💪
Need help with a tricky piece, loft move, or specialty item? Our team is ready to take a look.
#MovingOfAmerica #MovingDay #Movers #NJMovers #NewJerseyMovers #NewJerseyMovingCompany #SpecialtyMovers #FurnitureMoving #FurnitureMovers #ResidentialMoving #HomeMoving #LoftMove #ApartmentMovers #CondoMovers #CarefulMovers #ProfessionalMovers #MovingTips #MovingHelp #RelocationServices #TriStateMovers #BergenCountyMovers #EssexCountyMovers #PassaicCountyMovers #MorrisCountyMovers #HudsonCountyMovers #NJRealEstate #MovingCompanyNJ
When the stairs are not the best option, we find another way.
This wrapped furniture piece needed a careful handoff from the loft level, so our team protected the space, set the ladders, wrapped the item, and worked together one step at a time.
Moves like this are all about patience, communication, and knowing when to slow down. That is how we protect the home, the furniture, and everyone on the job. 💪
Need help with a tricky piece, loft move, or specialty item? Our team is ready to take a look.
#MovingOfAmerica #MovingDay #Movers #NJMovers #NewJerseyMovers #NewJerseyMovingCompany #SpecialtyMovers #FurnitureMoving #FurnitureMovers #ResidentialMoving #HomeMoving #LoftMove #ApartmentMovers #CondoMovers #CarefulMovers #ProfessionalMovers #MovingTips #MovingHelp #RelocationServices #TriStateMovers #BergenCountyMovers #EssexCountyMovers #PassaicCountyMovers #MorrisCountyMovers #HudsonCountyMovers #NJRealEstate #MovingCompanyNJ
...
Everything had to come out, then everything had to go back exactly right.
Our team assisted a production company with a two stage gym equipment move. First, we disassembled and removed the equipment. Then we returned to bring everything back in, reassemble the pieces, and helped get the space ready again.
This is the kind of move where the small details matter. Bolts, platforms, racks, benches, heavy pieces, tight angles. It all has to be handled with patience and the right team. 💪
Need gym equipment moved, stored, or reassembled? Our team can help.
#MovingOfAmerica #GymEquipmentMovers #GymEquipmentMove #FitnessEquipmentMovers #CommercialMovers #CommercialMoving #SpecialtyMovers #EquipmentMoving #GymRelocation #GymSetup #FitnessStudioMove #ProductionMove #BehindTheMove #MovingDay #MovingCompany #ProfessionalMovers #NJMovers #NewJerseyMovers #LocalMovers #TriStateMovers #PassaicCounty #BergenCounty #EssexCounty #CliftonNJ #HawthorneNJ #RidgefieldNJ #ShortHillsNJ #StorageNJ
Everything had to come out, then everything had to go back exactly right.
Our team assisted a production company with a two stage gym equipment move. First, we disassembled and removed the equipment. Then we returned to bring everything back in, reassemble the pieces, and helped get the space ready again.
This is the kind of move where the small details matter. Bolts, platforms, racks, benches, heavy pieces, tight angles. It all has to be handled with patience and the right team. 💪
Need gym equipment moved, stored, or reassembled? Our team can help.
#MovingOfAmerica #GymEquipmentMovers #GymEquipmentMove #FitnessEquipmentMovers #CommercialMovers #CommercialMoving #SpecialtyMovers #EquipmentMoving #GymRelocation #GymSetup #FitnessStudioMove #ProductionMove #BehindTheMove #MovingDay #MovingCompany #ProfessionalMovers #NJMovers #NewJerseyMovers #LocalMovers #TriStateMovers #PassaicCounty #BergenCounty #EssexCounty #CliftonNJ #HawthorneNJ #RidgefieldNJ #ShortHillsNJ #StorageNJ
...
Heavy. Valuable. Zero room for mistakes. 🎹📦
From pianos to priceless pieces, we don’t just move items… we move them right.
Careful planning, precision handling, and the kind of strength that knows when to go slow.
Because some things aren’t just heavy… they’re everything.
#MovingOfAmerica #MovingCompany #PianoMoving #HeavyLifting #ProfessionalMovers #MovingDay #SafeMove #WhiteGloveService #PackAndMove #StressFreeMove #MoversLife #Logistics #HandleWithCare
Heavy. Valuable. Zero room for mistakes. 🎹📦
From pianos to priceless pieces, we don’t just move items… we move them right.
Careful planning, precision handling, and the kind of strength that knows when to go slow.
Because some things aren’t just heavy… they’re everything.
#MovingOfAmerica #MovingCompany #PianoMoving #HeavyLifting #ProfessionalMovers #MovingDay #SafeMove #WhiteGloveService #PackAndMove #StressFreeMove #MoversLife #Logistics #HandleWithCare
...
No surprises. No hidden fees. No last-minute plot twists. 💯
What we quote is what you pay… simple as that.
We believe moving should feel clear, honest, and stress-free from start to finish.
Because trust isn’t built on fine print… it’s built on keeping our word.
#MovingOfAmerica #HonestMoving #NoHiddenFees #MovingCompany #TransparentPricing #StressFreeMove #ProfessionalMovers #MovingDay #Trustworthy #ReliableMovers
No surprises. No hidden fees. No last-minute plot twists. 💯
What we quote is what you pay… simple as that.
We believe moving should feel clear, honest, and stress-free from start to finish.
Because trust isn’t built on fine print… it’s built on keeping our word.
#MovingOfAmerica #HonestMoving #NoHiddenFees #MovingCompany #TransparentPricing #StressFreeMove #ProfessionalMovers #MovingDay #Trustworthy #ReliableMovers
...
Pool table? No problem. 🎱💪
Heavy, delicate, and built like a tank, but our crew moves it with precision and care. When it comes to moving the tough stuff, we’ve got it handled. 🚚📦
Hashtags:
#pooltablemoving #heavylifting #movingcompany #professionalmovers #movingday #nycmovers #njmovers #hobokenmovers #localmovers #relocation
Pool table? No problem. 🎱💪
Heavy, delicate, and built like a tank, but our crew moves it with precision and care. When it comes to moving the tough stuff, we’ve got it handled. 🚚📦
Hashtags:
#pooltablemoving #heavylifting #movingcompany #professionalmovers #movingday #nycmovers #njmovers #hobokenmovers #localmovers #relocation
...
Serving looks and moving boxes. ✨
From snapshots to heavy lifts, we make every move look effortless. 💪📦
#MovingInStyle #QualityMovers #ChicMoves #StressFreeMove #MovingDay
Serving looks and moving boxes. ✨
From snapshots to heavy lifts, we make every move look effortless. 💪📦
#MovingInStyle #QualityMovers #ChicMoves #StressFreeMove #MovingDay
...





















395 Broad Avenue
Ridgefield, NJ 07657
New Jersey: 201-862-8000
New York: 646-844-8000
Copyright © 2026 Moving of America Inc. All Right Reserved. | 395 Broad Avenue, Ridgefield, NJ 07657
Licensed and Insured: US DOT 1601312 | MC 592337 | NY DOT 38444 | NJ 39PC00096600
Moving of America™ is a registered trademark of Moving of America Inc. in the United States and in other countries.
(function () {
'use strict';
// ─── Config ───────────────────────────────────────────────────────────────
var CONFIG = {
brand: {
primary: '#1E469B',
primaryLight: '#2a5bbf',
accent: '#ffffff',
text: '#1a1a2e',
textLight: '#555e7a',
bg: '#ffffff',
highlight: '#e8eeff',
border: '#dde4f5',
panelBg: '#f4f7ff',
},
zIndex: 9990,
font: "'Montserrat', sans-serif",
};
// ─── Inject Montserrat ────────────────────────────────────────────────────
if (!document.querySelector('link[href*="Montserrat"]')) {
var lnk = document.createElement('link');
lnk.rel = 'stylesheet';
lnk.href = 'https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap';
document.head.appendChild(lnk);
}
// ─── Styles ───────────────────────────────────────────────────────────────
var css = '\
#moa-toc-btn {\
position:fixed;right:0;top:50%;transform:translateY(-50%);\
z-index:' + CONFIG.zIndex + ';display:flex;flex-direction:column;\
align-items:center;justify-content:center;\
width:40px;min-height:110px;\
background:' + CONFIG.brand.primary + ';color:#fff;\
border-radius:10px 0 0 10px;\
cursor:pointer;box-shadow:-3px 0 16px rgba(30,70,155,.18);\
transition:background .2s,width .2s;\
border:none;outline:none;padding:14px 0;gap:8px;\
font-family:' + CONFIG.font + ';\
}\
#moa-toc-btn:hover{background:' + CONFIG.brand.primaryLight + ';width:44px;}\
#moa-toc-btn-label{\
writing-mode:vertical-rl;text-orientation:mixed;\
font-size:10px;font-weight:700;letter-spacing:.12em;\
text-transform:uppercase;color:#fff;\
font-family:' + CONFIG.font + ';line-height:1;\
}\
#moa-toc-count{\
background:#fff;color:' + CONFIG.brand.primary + ';\
font-size:9px;font-weight:700;font-family:' + CONFIG.font + ';\
border-radius:10px;padding:2px 5px;\
min-width:18px;text-align:center;line-height:1.4;\
}\
#moa-toc-overlay{\
position:fixed;inset:0;background:rgba(10,20,60,.32);\
z-index:' + (CONFIG.zIndex + 1) + ';\
opacity:0;pointer-events:none;transition:opacity .3s;\
}\
#moa-toc-overlay.moa-open{opacity:1;pointer-events:all;}\
#moa-toc-panel{\
position:fixed;right:0;top:0;height:100%;\
width:320px;max-width:92vw;\
background:' + CONFIG.brand.bg + ';\
z-index:' + (CONFIG.zIndex + 2) + ';\
box-shadow:-6px 0 32px rgba(30,70,155,.15);\
transform:translateX(100%);\
transition:transform .32s cubic-bezier(.4,0,.2,1);\
display:flex;flex-direction:column;\
font-family:' + CONFIG.font + ';overflow:hidden;\
}\
#moa-toc-panel.moa-open{transform:translateX(0);}\
#moa-toc-header{\
background:' + CONFIG.brand.primary + ';color:#fff;\
padding:20px 18px 16px;\
display:flex;align-items:center;justify-content:space-between;\
flex-shrink:0;\
}\
#moa-toc-header-left{display:flex;flex-direction:column;gap:3px;}\
#moa-toc-title{font-size:13px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#fff;}\
#moa-toc-subtitle{font-size:10px;font-weight:500;color:rgba(255,255,255,.7);letter-spacing:.04em;}\
#moa-toc-close{\
background:rgba(255,255,255,.15);border:none;color:#fff;\
width:30px;height:30px;border-radius:50%;cursor:pointer;\
display:flex;align-items:center;justify-content:center;\
transition:background .2s;flex-shrink:0;\
}\
#moa-toc-close:hover{background:rgba(255,255,255,.28);}\
#moa-toc-body{\
flex:1;overflow-y:auto;padding:10px 0 20px;\
background:' + CONFIG.brand.bg + ';\
}\
#moa-toc-body::-webkit-scrollbar{width:4px;}\
#moa-toc-body::-webkit-scrollbar-track{background:' + CONFIG.brand.panelBg + ';}\
#moa-toc-body::-webkit-scrollbar-thumb{background:' + CONFIG.brand.border + ';border-radius:4px;}\
.moa-toc-item{\
display:flex;align-items:center;gap:12px;\
padding:10px 18px;cursor:pointer;\
transition:background .15s;\
border-left:3px solid transparent;\
}\
.moa-toc-item:hover,.moa-toc-item.moa-active{\
background:' + CONFIG.brand.highlight + ';\
border-left-color:' + CONFIG.brand.primary + ';\
}\
.moa-toc-num{\
font-size:10px;font-weight:700;color:' + CONFIG.brand.primary + ';\
background:' + CONFIG.brand.highlight + ';border:1.5px solid ' + CONFIG.brand.border + ';\
border-radius:5px;min-width:22px;height:22px;\
display:flex;align-items:center;justify-content:center;\
flex-shrink:0;font-family:' + CONFIG.font + ';\
}\
.moa-toc-text{\
font-size:12.5px;font-weight:500;color:' + CONFIG.brand.text + ';\
line-height:1.35;font-family:' + CONFIG.font + ';\
}\
.moa-toc-item:hover .moa-toc-text,.moa-toc-item.moa-active .moa-toc-text{\
color:' + CONFIG.brand.primary + ';\
}\
#moa-toc-empty{\
padding:32px 18px;text-align:center;\
color:' + CONFIG.brand.textLight + ';\
font-size:12px;font-family:' + CONFIG.font + ';\
}\
#moa-toc-footer{\
padding:12px 18px;border-top:1px solid ' + CONFIG.brand.border + ';\
font-size:10px;color:' + CONFIG.brand.textLight + ';\
font-family:' + CONFIG.font + ';text-align:center;\
flex-shrink:0;background:' + CONFIG.brand.panelBg + ';\
}\
';
var styleEl = document.createElement('style');
styleEl.id = 'moa-toc-styles';
styleEl.textContent = css;
document.head.appendChild(styleEl);
// ─── Build DOM ────────────────────────────────────────────────────────────
// Overlay
var overlay = document.createElement('div');
overlay.id = 'moa-toc-overlay';
document.body.appendChild(overlay);
// Panel
var panel = document.createElement('div');
panel.id = 'moa-toc-panel';
panel.setAttribute('role', 'dialog');
panel.setAttribute('aria-label', 'Page Contents');
panel.innerHTML =
'' +
'' +
'Page Contents' +
'Jump to any section' +
'' +
'' +
'' +
'' +
'Moving of America — Page Navigation';
document.body.appendChild(panel);
// Floating Button
var btn = document.createElement('button');
btn.id = 'moa-toc-btn';
btn.setAttribute('aria-label', 'Open page contents');
btn.innerHTML =
'' +
'Contents' +
'—';
document.body.appendChild(btn);
// ─── Helpers ──────────────────────────────────────────────────────────────
function getH2s() {
// Exclude H2s inside nav, header, footer, and widget panels
return Array.from(document.querySelectorAll('h2')).filter(function (h) {
var text = h.textContent.trim();
if (!text) return false;
// Skip if inside nav/header/footer
var el = h;
while (el) {
var tag = el.tagName ? el.tagName.toLowerCase() : '';
if (tag === 'nav' || tag === 'header' || tag === 'footer') return false;
if (el.id === 'moa-toc-panel') return false;
el = el.parentElement;
}
return true;
});
}
function ensureId(el, idx) {
if (!el.id) el.id = 'moa-section-' + idx;
return el.id;
}
function buildTOC() {
var body = document.getElementById('moa-toc-body');
var count = document.getElementById('moa-toc-count');
var h2list = getH2s();
body.innerHTML = '';
count.textContent = h2list.length;
if (!h2list.length) {
var empty = document.createElement('div');
empty.id = 'moa-toc-empty';
empty.textContent = 'No sections found on this page.';
body.appendChild(empty);
return;
}
h2list.forEach(function (h, i) {
var id = ensureId(h, i);
var item = document.createElement('div');
item.className = 'moa-toc-item';
item.setAttribute('role', 'button');
item.setAttribute('tabindex', '0');
item.innerHTML =
'' + (i + 1) + '' +
'' + h.textContent.trim() + '';
item.addEventListener('click', function () {
closePanel();
setTimeout(function () {
var target = document.getElementById(id);
if (target) {
var top = target.getBoundingClientRect().top + window.pageYOffset - 90;
window.scrollTo({ top: top, behavior: 'smooth' });
}
}, 340);
});
item.addEventListener('keydown', function (e) {
if (e.key === 'Enter' || e.key === ' ') item.click();
});
body.appendChild(item);
});
}
// ─── Open / Close ─────────────────────────────────────────────────────────
function openPanel() {
buildTOC();
panel.classList.add('moa-open');
overlay.classList.add('moa-open');
document.body.style.overflow = 'hidden';
}
function closePanel() {
panel.classList.remove('moa-open');
overlay.classList.remove('moa-open');
document.body.style.overflow = '';
}
// ─── Active highlight on scroll ───────────────────────────────────────────
function updateActive() {
var items = document.querySelectorAll('.moa-toc-item');
var h2list = getH2s();
var active = 0;
h2list.forEach(function (h, i) {
if (h.getBoundingClientRect().top <= 130) active = i;
});
items.forEach(function (item, i) {
item.classList.toggle('moa-active', i === active);
});
}
// ─── Events ───────────────────────────────────────────────────────────────
btn.addEventListener('click', openPanel);
overlay.addEventListener('click', closePanel);
document.getElementById('moa-toc-close').addEventListener('click', closePanel);
document.addEventListener('keydown', function (e) {
if (e.key === 'Escape') closePanel();
});
window.addEventListener('scroll', updateActive, { passive: true });
// ─── Init: poll until H2s are present (handles Elementor lazy render) ─────
function initCount() {
var h2list = getH2s();
document.getElementById('moa-toc-count').textContent = h2list.length || '—';
}
var pollAttempts = 0;
function pollForH2s() {
var h2list = getH2s();
if (h2list.length > 0) {
initCount();
return;
}
pollAttempts++;
if (pollAttempts < 20) {
setTimeout(pollForH2s, 300);
} else {
// Give up gracefully — button still works, will find H2s on click
document.getElementById('moa-toc-count').textContent = '?';
}
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', pollForH2s);
} else {
pollForH2s();
}
})();